Rails 4.1
Sequel 4.18
PostgreSQL 9.3.5
Hello, I am using the timestamps plugin to ensure that created_at and
updated_at are filled in automatically. These columns are set up as
TIMESTAMP WITHOUT TIMEZONE,
but I wish to write these values in UTC. To do this, I assumed I could set
config.sequel.default_timezone = :utc, but that doesn't appear to be the
case; the values are being
written in local time.
Any help would be greatly appreciated, thanks.
Here is the pertinent chunk of my application.rb
config.assets.precompile << /\.(?:svg|eot|woff|ttf|png|jpg|jpeg|gif|)\z/
# Allowed options: :sql, :ruby.
config.sequel.schema_format = :sql
config.sequel.default_timezone = :utc
# Whether to dump the schema after successful migrations.
# Defaults to false in production and test, true otherwise.
config.sequel.schema_dump = Rails.env == 'development' ? true : false
config.sequel.after_connect = proc do
Sequel::Model.plugin :active_model
Sequel::Model.plugin :timestamps, update_on_create: true
Sequel::Model.plugin :forme
Sequel::Model.plugin :rails_extensions
Sequel::Model.plugin :after_initialize
Sequel::Model.plugin :validation_helpers
Sequel::Model.plugin Sequel::Plugins::ActiveAssociations
Sequel::Model.db.extension :pagination
Sequel::Model.db.extension :pg_hstore
Sequel::Model.db.extension :pg_array
end
Sean
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.