Add DSL for urls

This commit is contained in:
Jordan Faust
2014-09-01 13:44:22 -05:00
parent 98a3e5696e
commit ad0859e262
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)
@@ -40,6 +42,7 @@ PostSerializer = Class.new(ActiveModel::Serializer) do
attributes :title, :body, :id
has_many :comments
url :comments
end
CommentSerializer = Class.new(ActiveModel::Serializer) do