module Sequel::Postgres::IntervalDatasetMethods

Private Instance Methods

auto_param_type_fallback(v) click to toggle source

Allow auto parameterization of ActiveSupport::Duration instances.

Calls superclass method
# File lib/sequel/extensions/pg_interval.rb, line 200
def auto_param_type_fallback(v)
  if defined?(super) && (type = super)
    type
  elsif ActiveSupport::Duration === v
    "::interval"
  end
end
literal_other_append(sql, v) click to toggle source

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

Calls superclass method
# File lib/sequel/extensions/pg_interval.rb, line 210
def literal_other_append(sql, v)
  case v
  when ActiveSupport::Duration
    literal_append(sql, IntervalDatabaseMethods.literal_duration(v))
    sql << '::interval'
  else
    super
  end
end