mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #7569 from skorfmann/improve-has-many-through-exception-message
Improve exception message for HasManyThroughAssociationPolymorphicSourceError
This commit is contained in:
commit
8295663558
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ module ActiveRecord
|
|||
|
||||
class HasManyThroughAssociationPolymorphicSourceError < ActiveRecordError #:nodoc:
|
||||
def initialize(owner_class_name, reflection, source_reflection)
|
||||
super("Cannot have a has_many :through association '#{owner_class_name}##{reflection.name}' on the polymorphic object '#{source_reflection.class_name}##{source_reflection.name}'.")
|
||||
super("Cannot have a has_many :through association '#{owner_class_name}##{reflection.name}' on the polymorphic object '#{source_reflection.class_name}##{source_reflection.name}' without 'source_type'. Try adding 'source_type: \"#{reflection.name.to_s.classify}\"' to 'has_many :through' definition.")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue