Skip to content

Instantly share code, notes, and snippets.

@mculp
Created March 23, 2011 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mculp/884095 to your computer and use it in GitHub Desktop.
Save mculp/884095 to your computer and use it in GitHub Desktop.
>> c = CarSearch.last
=> #<CarSearch id: 906, start_date_time: "2011-03-30 12:00:00", ...>
>> cs = c.clone
=> #<CarSearch id: nil, start_date_time: "2011-03-30 12:00:00", ...>
>> cs.attributes
=> {"start_date_time"=>Wed Mar 30 12:00:00 -0500 2011, ...}
>> cs.read_attribute :start_date_time
=> Wed Mar 30 12:00:00 -0500 2011
>> cs.start_date_time
=> Wed Mar 23 17:45:08 -0500 2011
>> cs.write_attribute(:start_date_time, cs.read_attribute(:start_date_time))
=> Wed Mar 30 12:00:00 -0500 2011
>> cs.start_date_time
=> Wed Mar 30 12:00:00 -0500 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment