Module: ActiveRecord::ConnectionAdapters::Quoting

Defined in:
lib/enum/quoting.rb

Instance Method Summary collapse

Instance Method Details

#__quote_enumObject



4
# File 'lib/enum/quoting.rb', line 4

alias __quote_enum quote

#quote(value, column = nil) ⇒ Object

Quote a symbol as a normal string. This will support quoting of enumerated values.



8
9
10
11
12
13
14
# File 'lib/enum/quoting.rb', line 8

def quote(value, column = nil)
  if !value.is_a? Symbol
    __quote_enum(value, column)
  else
    ActiveRecord::Base.send(:quote_bound_value, value.to_s)
  end
end