mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Fix model attributes accessors
This commit is contained in:
10
test/fixtures/poro.rb
vendored
10
test/fixtures/poro.rb
vendored
@@ -1,6 +1,4 @@
|
||||
class Model < ActiveModelSerializers::Model
|
||||
FILE_DIGEST = Digest::MD5.hexdigest(File.open(__FILE__).read)
|
||||
|
||||
attr_writer :id
|
||||
|
||||
# At this time, just for organization of intent
|
||||
@@ -108,10 +106,6 @@ class PostPreviewSerializer < ActiveModel::Serializer
|
||||
has_many :comments, serializer: ::CommentPreviewSerializer
|
||||
belongs_to :author, serializer: ::AuthorPreviewSerializer
|
||||
end
|
||||
class PostWithTagsSerializer < ActiveModel::Serializer
|
||||
attributes :id
|
||||
has_many :tags
|
||||
end
|
||||
class PostWithCustomKeysSerializer < ActiveModel::Serializer
|
||||
attributes :id
|
||||
has_many :comments, key: :reviews
|
||||
@@ -208,10 +202,6 @@ module Spam
|
||||
end
|
||||
end
|
||||
|
||||
class Tag < Model
|
||||
attributes :name
|
||||
end
|
||||
|
||||
class VirtualValue < Model; end
|
||||
class VirtualValueSerializer < ActiveModel::Serializer
|
||||
attributes :id
|
||||
|
||||
Reference in New Issue
Block a user