Guest User

Untitled

a guest
Apr 26th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. >> prefs = {:foo => 2, :bar => 3, :baz => 4}
  2. => {:bar=>3, :foo=>2, :baz=>4}
  3. >> item = Hotel.find(1)
  4. => #<Hotel id: 1, snip>
  5. >> prefs.each {|k,v| item[k] = v}
  6. => {:bar=>3, :foo=>2, :baz=>4}
  7. >> item[:bar]
  8. => 3
  9. >> item[:baz]
  10. => 4
Add Comment
Please, Sign In to add comment