Method: ActiveRecord::ConnectionAdapters::SQLite3::Quoting#quote_default_expression

Defined in:
activerecord/lib/active_record/connection_adapters/sqlite3/quoting.rb

#quote_default_expression(value, column) ⇒ Object

:nodoc:



86
87
88
89
90
91
92
93
94
95
96
97
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/quoting.rb', line 86

def quote_default_expression(value, column) # :nodoc:
  if value.is_a?(Proc)
    value = value.call
    if value.match?(/\A\w+\(.*\)\z/)
      "(#{value})"
    else
      value
    end
  else
    super
  end
end