File tree Expand file tree Collapse file tree 4 files changed +5
-4
lines changed Expand file tree Collapse file tree 4 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1111- [ #2307 ] ( https://github.com/rails-api/active_model_serializers/pull/2307 ) Falsey attribute values should not be reevaluated.
1212
1313Misc:
14+ - [ #2309 ] ( https://github.com/rails-api/active_model_serializers/pull/2309 ) Performance and memory usage fixes
1415
1516### [ v0.10.8 (2018-11-01)] ( https://github.com/rails-api/active_model_serializers/compare/v0.10.7...v0.10.8 )
1617
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class Serializer
99 delegate :collection? , to : :reflection
1010
1111 def reflection_options
12- @reflection_options ||= reflection . options . dup . reject { |k , _ | ! REFLECTION_OPTIONS . include? ( k ) }
12+ @reflection_options ||= reflection . options . select { |k , _ | REFLECTION_OPTIONS . include? ( k ) }
1313 end
1414
1515 def object
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def adapter_map
3737
3838 # @return [Array<Symbol>] list of adapter names
3939 def adapters
40- adapter_map . keys . sort
40+ adapter_map . keys . sort!
4141 end
4242
4343 # Adds an adapter 'klass' with 'name' to the 'adapter_map'
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ class SerializableResource
1616 # @return the serializable_resource, ready for #as_json/#to_json/#serializable_hash.
1717 def initialize ( resource , options = { } )
1818 @resource = resource
19- @adapter_opts , @serializer_opts =
20- options . partition { |k , _ | ADAPTER_OPTION_KEYS . include? k } . map { | h | Hash [ h ] }
19+ @adapter_opts = options . select { | k , _ | ADAPTER_OPTION_KEYS . include? k }
20+ @serializer_opts = options . reject { |k , _ | ADAPTER_OPTION_KEYS . include? k }
2121 end
2222
2323 def serialization_scope = ( scope )
You can’t perform that action at this time.
0 commit comments