instance method
validate_reflection!
Ruby on Rails 7.1.6
Since v7.1.6 Last seen in v7.1.6 PrivateSignature
validate_reflection!()
No documentation comment.
Source
# File activerecord/lib/active_record/reflection.rb, line 438
def validate_reflection!
return unless options[:foreign_key].is_a?(Array)
message = <<~MSG.squish
Passing #{options[:foreign_key]} array to :foreign_key option
on the #{active_record}##{name} association is not supported.
Use the query_constraints: #{options[:foreign_key]} option instead to represent a composite foreign key.
MSG
raise ArgumentError, message
end
Defined in activerecord/lib/active_record/reflection.rb line 438
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Reflection::MacroReflection