instance method
add_relations_to_bind_values
Ruby on Rails 4.1.16
Since v4.1.16 Last seen in v4.2.9 PrivateAvailable in: v4.1.16 v4.2.9
Signature
add_relations_to_bind_values(attributes)
This function is recursive just for better readablity. #where argument doesn’t support more than one level nested hash in real world.
Parameters
-
attributesreq
Source
# File activerecord/lib/active_record/relation/query_methods.rb, line 1117
def add_relations_to_bind_values(attributes)
if attributes.is_a?(Hash)
attributes.each_value do |value|
if value.is_a?(ActiveRecord::Relation)
self.bind_values += value.bind_values
else
add_relations_to_bind_values(value)
end
end
end
end
Defined in activerecord/lib/active_record/relation/query_methods.rb line 1117
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::QueryMethods