File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed
lib/active_model/serializer Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -26,26 +26,12 @@ class Serializer
2626 # So you can inspect reflections in your Adapters.
2727 #
2828 Reflection = Struct . new ( :name , :options , :block ) do
29- delegate :call , to : :reader
30-
31- attr_reader :reader
32-
33- def initialize ( *)
34- super
35- @reader = self . class . build_reader ( name , block )
36- end
37-
3829 # @api private
3930 def value ( instance )
40- call ( instance )
41- end
42-
43- # @api private
44- def self . build_reader ( name , block )
4531 if block
46- -> ( instance ) { instance . read_attribute_for_serialization ( name ) . instance_eval ( &block ) }
32+ instance . read_attribute_for_serialization ( name ) . instance_eval ( &block )
4733 else
48- -> ( instance ) { instance . read_attribute_for_serialization ( name ) }
34+ instance . read_attribute_for_serialization ( name )
4935 end
5036 end
5137
You can’t perform that action at this time.
0 commit comments