Sha256: 33c7cac7592e37b29e6c77b19e5aba838f30d2611fd9537fe148030e4c96c38a

Contents?: true

Size: 306 Bytes

Versions: 1

Compression:

Stored size: 306 Bytes

Contents

class Product < ActiveRecord::Base

  has_many :product_has_categories
  has_many :categories, :through => :product_has_categories

  alias_method :category_ids_old=, :category_ids=

  def category_ids=(ids)
    ids = ids.split(",").map(&:to_i) if ids.is_a?(String)
    self.category_ids_old=ids
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
token_field-2.0.0 spec/dummy/app/models/product.rb