method

to_h

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: WhereClause
to_h(table_name = nil, equality_only: false) public

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/where_clause.rb, line 61
      def to_h(table_name = nil, equality_only: false)
        equalities(predicates, equality_only).each_with_object({}) do |node, hash|
          next if table_name&.!= node.left.relation.name
          name = node.left.name.to_s
          value = extract_node_value(node.right)
          hash[name] = value
        end
      end
Register or log in to add new notes.