Merge pull request #2307 from faucct/bugfix/double-evaluation-of-object

Reevaluation of object
This commit is contained in:
Benjamin Fleischer 2019-01-10 11:58:27 -06:00 committed by GitHub
commit c6c3927e00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Features:
Fixes: Fixes:
- [#2307](https://github.com/rails-api/active_model_serializers/pull/2307) Falsey attribute values should not be reevaluated.
Misc: Misc:

View File

@ -13,7 +13,8 @@ module ActiveModel
end end
def object def object
@object ||= reflection.value( return @object if defined?(@object)
@object = reflection.value(
association_options.fetch(:parent_serializer), association_options.fetch(:parent_serializer),
association_options.fetch(:include_slice) association_options.fetch(:include_slice)
) )