Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6523

Show
Ignore:
Timestamp:
04/15/07 18:23:24 (1 year ago)
Author:
rick
Message:

dont try to convert times to tztime if they're not a valid Time

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/tztime/lib/tz_time_helpers/active_record_methods.rb

    r6521 r6523  
    1313          define_method attribute do 
    1414            time = read_attribute(attribute) 
    15             if time.utc? 
     15            if (time.acts_like?(:time) || time.acts_like?(:date)) && time.utc? 
    1616              write_attribute(attribute, TzTime.at(Time.at(TzTime.zone.utc_to_local(time)))) 
    1717            else