Skip to content

Commit 32dbfa9

Browse files
committed
Style lint fixes
1 parent 9e0c527 commit 32dbfa9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/active_model/serializer/association.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def polymorphic_type
4747
end
4848

4949
def value
50-
@value ||= association_value = reflection_options.fetch(:association_value_proc).call
50+
@value ||= reflection_options.fetch(:association_value_proc).call
5151
end
5252

5353
def serializer

lib/active_model/serializer/reflection.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,22 @@ def build_association(parent_serializer, parent_serializer_options)
120120
association_value_proc = proc do
121121
value(parent_serializer)
122122
end
123-
serializer_proc = ->(association_value, reflection_options) {
123+
serializer_proc = lambda do |association_value, reflection_options|
124124
serializer_class = parent_serializer.class.serializer_for(association_value, reflection_options)
125125
if serializer_class
126126
begin
127127
serializer = reflection_options.fetch(:serializer, nil)
128128
serializer_options = parent_serializer_options.except(:serializer)
129129
serializer_options[:serializer] = serializer if serializer
130130
serializer_options[:serializer_context_class] = parent_serializer.class
131-
serializer = serializer_class.new(association_value, serializer_options)
131+
serializer_class.new(association_value, serializer_options)
132132
rescue ActiveModel::Serializer::CollectionSerializer::NoSerializerError
133133
reflection_options[:virtual_value] = association_value.try(:as_json) || association_value
134134
end
135135
elsif !association_value.nil? && !association_value.instance_of?(Object)
136136
reflection_options[:virtual_value] = association_value
137137
end
138-
}
138+
end
139139
reflection_options = options.dup
140140
reflection_options[:include_data] = @_include_data
141141
reflection_options[:new_options] = {

test/serializers/associations_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def test_belongs_to_doesnt_load_not_included_record_for_jsonapi
134134
def post.blog
135135
fail 'should use blog_id'
136136
end
137+
137138
def post.read_attribute_for_serialization(name)
138139
# Bug in how ActiveModelSerializers::Model handles attributes and methods
139140
send(name)

0 commit comments

Comments
 (0)