method

convert_dot_notation_to_hash

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: ActiveRecord::PredicateBuilder
convert_dot_notation_to_hash(attributes) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation/predicate_builder.rb, line 123
      def convert_dot_notation_to_hash(attributes)
        dot_notation = attributes.select do |k, v|
          k.include?(".".freeze) && !v.is_a?(Hash)
        end

        dot_notation.each_key do |key|
          table_name, column_name = key.split(".".freeze)
          value = attributes.delete(key)
          attributes[table_name] ||= {}

          attributes[table_name] = attributes[table_name].merge(column_name => value)
        end

        attributes
      end
Register or log in to add new notes.