mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
e8d1d84837
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.
17 lines
338 B
Ruby
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
|