Sha256: 2e3ab92406c50f1774e5bcca2a3c5fe516c2954998c72571639f066a6e05f9c9

Contents?: true

Size: 308 Bytes

Versions: 2

Compression:

Stored size: 308 Bytes

Contents

module Cavy
  class Item < ::ActiveRecord::Base

    belongs_to :cavy_item_group

    def create_params(type, params)
      data = {}
      data['type'] = type
      params.try(:each) do |param|
        data["#{param.downcase.gsub(' ', '_')}".to_sym] = ''
      end
      self.data = data
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cavy-0.1.0.beta2 app/models/cavy/item.rb
cavy-0.1.0.beta1 app/models/cavy/item.rb