File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
lib/active_model/serializer Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ def associations(include_tree = DEFAULT_INCLUDE_TREE)
8888
8989 Enumerator . new do |y |
9090 self . class . _reflections . each do |reflection |
91- next unless reflection . included ?( self )
91+ next if reflection . excluded ?( self )
9292 key = reflection . options . fetch ( :key , reflection . name )
9393 next unless include_tree . key? ( key )
9494 y . yield reflection . build_association ( self , instance_options )
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ module Attributes
1717 def attributes ( requested_attrs = nil , reload = false )
1818 @attributes = nil if reload
1919 @attributes ||= self . class . _attributes_data . each_with_object ( { } ) do |( key , attr ) , hash |
20- next unless attr . included ?( self )
20+ next if attr . excluded ?( self )
2121 next unless requested_attrs . nil? || requested_attrs . include? ( key )
2222 hash [ key ] = attr . value ( self )
2323 end
Original file line number Diff line number Diff line change @@ -24,14 +24,14 @@ def value(serializer)
2424 #
2525 # @api private
2626 #
27- def included ?( serializer )
27+ def excluded ?( serializer )
2828 case condition_type
2929 when :if
30- serializer . public_send ( condition )
31- when :unless
3230 !serializer . public_send ( condition )
31+ when :unless
32+ serializer . public_send ( condition )
3333 else
34- true
34+ false
3535 end
3636 end
3737
You can’t perform that action at this time.
0 commit comments