Skip to content

Instantly share code, notes, and snippets.

@zxiest
Created April 14, 2011 11:51
Show Gist options
  • Save zxiest/919322 to your computer and use it in GitHub Desktop.
Save zxiest/919322 to your computer and use it in GitHub Desktop.
irb(main):010:0> x
=> {"start_day"=>"M", "end_day"=>"F", "f_start_hour"=>"8", "start_minute"=>"00",
"start_ampm"=>"am", "f_end_hour"=>"7", "end_minute"=>"00", "end_ampm"=>"pm", "o
ld_record"=>"18"}
irb(main):011:0> temp = OperationInterval.find(18)
=> #<OperationInterval id: 18, days: nil, start_hour: nil, start_minute: 0, end_
hour: nil, end_minute: 0, closed: nil, created_at: "2011-04-14 09:28:21", update
d_at: "2011-04-14 09:28:21">
irb(main):012:0> temp.attributes= x
=> {"start_day"=>"M", "end_day"=>"F", "f_start_hour"=>"8", "start_minute"=>"00",
"start_ampm"=>"am", "f_end_hour"=>"7", "end_minute"=>"00", "end_ampm"=>"pm", "o
ld_record"=>"18"}
irb(main):013:0> temp
=> #<OperationInterval id: 18, days: nil, start_hour: nil, start_minute: 0, end_
hour: nil, end_minute: 0, closed: nil, created_at: "2011-04-14 09:28:21", update
d_at: "2011-04-14 09:28:21">
irb(main):014:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment