Method: ActiveRecord::ConnectionAdapters::PostgreSQL::Quoting#quoted_date

Defined in:
lib/active_record/connection_adapters/postgresql/quoting.rb

#quoted_date(value) ⇒ Object

Quote date/time values for use in SQL input.



105
106
107
108
109
110
111
112
# File 'lib/active_record/connection_adapters/postgresql/quoting.rb', line 105

def quoted_date(value) # :nodoc:
  if value.year <= 0
    bce_year = format("%04d", -value.year + 1)
    super.sub(/^-?\d+/, bce_year) + " BC"
  else
    super
  end
end