Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> prefs = {:foo => 2, :bar => 3, :baz => 4}
- => {:bar=>3, :foo=>2, :baz=>4}
- >> item = Hotel.find(1)
- => #<Hotel id: 1, snip>
- >> prefs.each {|k,v| item[k] = v}
- => {:bar=>3, :foo=>2, :baz=>4}
- >> item[:bar]
- => 3
- >> item[:baz]
- => 4
Add Comment
Please, Sign In to add comment