mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
075c81feec
To be possible to use a custom column name to save/read the polymorphic associated type in a has_many or has_one polymorphic association, now users can use the option :foreign_type to inform in what column the associated object type will be saved.
3 lines
129 B
Ruby
3 lines
129 B
Ruby
class Image < ActiveRecord::Base
|
|
belongs_to :imageable, foreign_key: :imageable_identifier, foreign_type: :imageable_class
|
|
end
|