i am receiving deprecation warning:
DEPRECATION WARNING: The following options in your Contact.belongs_to :customer declaration are deprecated: :conditions. Please use a scope block instead. For example, the following:
has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment'
should be rewritten as the following:
has_many :spam_comments, -> { where spam: true }, class_name: 'Comment'
Here is the line with :condition
belongs_to :customer, foreign_key: 'contactable_id',\
conditions: "contacts.contactable_type = 'Customer'"
I just try some variants, but can't fix. Maybe i am missing something
This should work:
belongs_to :customer, -> { where(contactable_type: 'Customer') },
foreign_key: 'contactable_id'
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments