Skip to content

Instantly share code, notes, and snippets.

@aguilarsoto
Created September 14, 2010 21:30
Show Gist options
  • Select an option

  • Save aguilarsoto/579808 to your computer and use it in GitHub Desktop.

Select an option

Save aguilarsoto/579808 to your computer and use it in GitHub Desktop.
irb(main):021:0> ash = Book.serializable_hash_options
=> {:include=>{:authorships=>{:only=>["id", "author_id", "book_id", "created_at", "updated_at"]}}, :only=>[:id, :title, :created_at, :updated_at, :epub_checksum]}
irb(main):022:0> ash2
=> {:include=>{:spine_items=>{:only=>["id", "author_id", "book_id", "created_at", "updated_at"]}}}
irb(main):023:0> ash.reverse_merge(ash2)
=> {:include=>{:authorships=>{:only=>["id", "author_id", "book_id", "created_at", "updated_at"]}}, :only=>[:id, :title, :created_at, :updated_at, :epub_checksum]}
irb(main):024:0> ash.merge(ash2)
=> {:include=>{:spine_items=>{:only=>["id", "author_id", "book_id", "created_at", "updated_at"]}}, :only=>[:id, :title, :created_at, :updated_at, :epub_checksum]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment