1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/models/shop.rb
Ujjwal Thaakar e8d1d84837
Don't try to get the subclass if the inheritance column doesn't exist
The `subclass_from_attrs` method is called even if the column specified by
the `inheritance_column` setting doesn't exist. This prevents setting associations
via the attributes hash if the association name clashes with the value of the setting,
typically `:type`. This worked previously in Rails 3.2.
2014-01-14 18:53:45 +05:30

17 lines
338 B
Ruby

module Shop
class Collection < ActiveRecord::Base
has_many :products, :dependent => :nullify
end
class Product < ActiveRecord::Base
has_many :variants, :dependent => :delete_all
belongs_to :type
class Type < ActiveRecord::Base
has_many :products
end
end
class Variant < ActiveRecord::Base
end
end