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 11
11
- [ #2307 ] ( https://github.com/rails-api/active_model_serializers/pull/2307 ) Falsey attribute values should not be reevaluated.
12
12
13
13
Misc:
14
+ - [ #2309 ] ( https://github.com/rails-api/active_model_serializers/pull/2309 ) Performance and memory usage fixes
14
15
15
16
### [ v0.10.8 (2018-11-01)] ( https://github.com/rails-api/active_model_serializers/compare/v0.10.7...v0.10.8 )
16
17
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class Serializer
9
9
delegate :collection? , to : :reflection
10
10
11
11
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 ) }
13
13
end
14
14
15
15
def object
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def adapter_map
37
37
38
38
# @return [Array<Symbol>] list of adapter names
39
39
def adapters
40
- adapter_map . keys . sort
40
+ adapter_map . keys . sort!
41
41
end
42
42
43
43
# 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
16
16
# @return the serializable_resource, ready for #as_json/#to_json/#serializable_hash.
17
17
def initialize ( resource , options = { } )
18
18
@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 }
21
21
end
22
22
23
23
def serialization_scope = ( scope )
You can’t perform that action at this time.
0 commit comments