My Rails 4 app config.eager_load = true will load activerecord datetime fields using Ruby Time class instead of ActiveSupport::TimeWithZone -



My Rails 4 app config.eager_load = true will load activerecord datetime fields using Ruby Time class instead of ActiveSupport::TimeWithZone -

i pushed rails 4 application new production env , noticed timestamp showed utc zone. have been shown correctly in other environment pst , application config.time_zone set in application.rb. farther triaging problem, discovered that, in production env, timestamp attributed of ruby class time, not activesupport::timewithzone

my_record.start_at.is_a?(activesupport::timewithzone) => false

but, in test env, timestamp attributed class activesupport::timewithzone

my_record.start_at.is_a?(activesupport::timewithzone) => true

this same code base, , vm cloned test, software versions same. checked production.rb file , didn't see anythings changes behavior. had

require 'rails/all'

in application.rb should load active back upwards modules @ start of app

the rest of application seems working fine, other active back upwards classes must loaded. can help me find out missing or changed in particular env?

thanks.

update: decided alter production.rb setting 1 @ time , found out caused by

config.eager_load = true

when alter value false -- activesupport timezone working again. .. still cannot explain why behavior changes when class pre-loaded. ideas?

ruby-on-rails activerecord activesupport

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -