Module: Sequel::Postgres::IntervalDatasetMethods

Defined in:
lib/sequel/extensions/pg_interval.rb

Instance Method Summary collapse

Instance Method Details

#literal_other_append(sql, v) ⇒ Object

Handle literalization of ActiveSupport::Duration objects, treating them as PostgreSQL intervals.


173
174
175
176
177
178
179
180
181
# File 'lib/sequel/extensions/pg_interval.rb', line 173

def literal_other_append(sql, v)
  case v
  when ActiveSupport::Duration
    literal_append(sql, IntervalDatabaseMethods.literal_duration(v))
    sql << '::interval'
  else
    super
  end
end