method
convert_dot_notation_to_hash
v6.1.7.7 -
Show latest stable
- Class:
ActiveRecord::PredicateBuilder
convert_dot_notation_to_hash(attributes)private
No documentation available.
# File activerecord/lib/active_record/relation/predicate_builder.rb, line 149
def convert_dot_notation_to_hash(attributes)
dot_notation = attributes.select do |k, v|
k.include?(".") && !v.is_a?(Hash)
end
dot_notation.each_key do |key|
table_name, column_name = key.split(".")
value = attributes.delete(key)
attributes[table_name] ||= {}
attributes[table_name] = attributes[table_name].merge(column_name => value)
end
attributes
end