Skip to content

Instantly share code, notes, and snippets.

@Houdini
Created Mar 26, 2012
Embed
What would you like to do?
class User < ActiveRecord::Base
self.default_timezone = 'Moscow' # работает на запись
# ...
end
1.8.7 :002 > User.first.act_ts
=> Sat, 20 Mar 2010 07:06:25 UTC +00:00
# нельзя поменять с change
================================
class User < ActiveRecord::Base
self.default_timezone = 'Moscow' # работает на запись
self.time_zone_aware_attributes = false
# ...
end
1.8.7 :002 > User.first.act_ts
Sat, 20 Mar 2010 07:06:25 +0000
# можно поменять с change
==============================
# И на чтение, и на запись работает если установить
# application.rb
config.time_zone = 'Moscow'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment