Method: Sequel::Postgres::IntervalDatabaseMethods.extended

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

.extended(db) ⇒ Object

Reset the conversion procs if using the native postgres adapter, and extend the datasets to correctly literalize ActiveSupport::Duration values.



143
144
145
146
147
148
149
150
151
152
# File 'lib/sequel/extensions/pg_interval.rb', line 143

def self.extended(db)
  db.instance_exec do
    extend_datasets(IntervalDatasetMethods)
    add_conversion_proc(1186, Postgres::IntervalDatabaseMethods::PARSER)
    if respond_to?(:register_array_type)
      register_array_type('interval', :oid=>1187, :scalar_oid=>1186)
    end
    @schema_type_classes[:interval] = ActiveSupport::Duration
  end
end