postgresql - Rails - custom timezone prevents from getting timestamps -


i'm using devise , grape

i'm facing problem timezones. whenever set timezone in environment:

config.time_zone = 'asia/dubai' config.active_record.default_timezone = 'asia/dubai' 

when record db , try access 1 of timestamps get

user.first user.reset_password_sent_at #=> nil 

and weirdest part of see column filled valid timestamp in db.

i tried run update manually via rails console. after updating record ran reload , reset_password_sent_at vanished. again got "nil".

what can cause of , how can overcome?

i found out cause.

i set the

config.time_zone = 'asia/dubai' config.active_record.default_timezone = 'asia/dubai' 

where should set time of application, not activerecord. in config should like:

config.time_zone = 'asia/dubai' 

now i'm getting data database.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -