Module: WithoutScope::QuotedColumnConditions::ClassMethods

Defined in:
lib/acts_as_revisable/quoted_columns.rb

Instance Method Summary collapse

Instance Method Details

#quote_bound_value(value) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/acts_as_revisable/quoted_columns.rb', line 19

def quote_bound_value(value)
  if value.is_a?(Symbol) && column_names.member?(value.to_s)
    # code borrowed from sanitize_sql_hash_for_conditions
    attr = value.to_s
    table_name = quoted_table_name
    
    return "#{table_name}.#{connection.quote_column_name(attr)}"
  end
  
  super(value)
end