Forum: Ruby on Rails tztime (tz_time_attributes) problem with callbacks

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Def2c63c6beefdb5ca3e6ec54d04a4a4?d=identicon&s=25 Trevor Turk (trevorturk)
on 2007-07-20 03:46
I'm having an odd problem with the tztime plugin, where the
tz_time_attributes method seems to have trouble when used within a

I'm getting a nil object error:

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.utc_to_local

app/controllers/application.rb:111:in `get_options'
app/controllers/application.rb:75:in `set_timezone'

Here's the offending code:

The second line of the after_create method seems to be the problem. When
I remove the tz_time_attributes call in the model, the problem goes

Any ideas on how to work around this issue would be very much

This topic is locked and can not be replied to.