Skip to content

Instantly share code, notes, and snippets.

@inem
Created August 21, 2009 06:58
Show Gist options
  • Select an option

  • Save inem/171702 to your computer and use it in GitHub Desktop.

Select an option

Save inem/171702 to your computer and use it in GitHub Desktop.
:json => concat_json({
# :items => items.to_json(:methods => [:beds, :capacity, :title]),
# :locations => locations.to_json(:methods => :address, :include => :items)
:items => items.to_json(:methods => [:beds, :capacity],
:except => [:created_at, :updated_at, :search_timestamp, :verified, :active, :subcategories]),
:locations => locations.to_json(:methods => :address, :include => {:items => {:only => [:id], :methods => []}})
})
@items
-methods
:beds
:capacity
:title
-except
:create_at
:updated_at
:search_timestamp
:verified
:active
:subcategories
@locations
-methods
:adress
+items
-only
:id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment