Skip to content

Instantly share code, notes, and snippets.

@shwoodard
Created September 23, 2012 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shwoodard/3772363 to your computer and use it in GitHub Desktop.
Save shwoodard/3772363 to your computer and use it in GitHub Desktop.
class ProjectSerializer < ActiveModel::Serializer
embed :ids, :include => true
attributes :id, :name
has_many :solutions
def as_json(options = {})
hash = super(options)
hash[:solutions].each{|solution| solution.delete(:stories) }
hash.delete(:stories)
hash
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment