Merge pull request #625 from JordanFaust/feature/url-dsl

Add DSL for urls
This commit is contained in:
Steve Klabnik
2014-10-14 11:47:14 -04:00
3 changed files with 39 additions and 0 deletions

View File

@@ -31,6 +31,8 @@ end
class ProfileSerializer < ActiveModel::Serializer
attributes :name, :description
urls :posts, :comments
end
Post = Class.new(Model)
@@ -41,6 +43,7 @@ PostSerializer = Class.new(ActiveModel::Serializer) do
attributes :title, :body, :id
has_many :comments
url :comments
end
CommentSerializer = Class.new(ActiveModel::Serializer) do