Distinguish options ivar from local; Extract latent Adapter::CachedSerializer

This commit is contained in:
Benjamin Fleischer
2015-09-16 22:12:13 -05:00
parent 3f0794bd39
commit 9d65f0adc5
10 changed files with 131 additions and 100 deletions

View File

@@ -60,7 +60,7 @@ class ProfileSerializer < ActiveModel::Serializer
attributes :name, :description
def arguments_passed_in?
options[:my_options] == :accessible
instance_options[:my_options] == :accessible
end
end
@@ -102,7 +102,7 @@ PostSerializer = Class.new(ActiveModel::Serializer) do
end
def custom_options
options
instance_options
end
end
@@ -123,7 +123,7 @@ CommentSerializer = Class.new(ActiveModel::Serializer) do
belongs_to :author
def custom_options
options
instance_options
end
end