Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reevaluation of object #2307

Merged

Conversation

faucct
Copy link

@faucct faucct commented Dec 29, 2018

Object gets reevaluated when value is nil or false. I don't know where to put a test on this.

@@ -11,7 +11,8 @@ def reflection_options
end

def object
@object ||= reflection.value(
return @object if defined?(@object)
@object = reflection.value(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine to me. I write code like this all the time.

mind adding an entry to the changelog under fixes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@faucct faucct force-pushed the bugfix/double-evaluation-of-object branch from 34ee253 to a39794d Compare January 9, 2019 06:52
@bf4 bf4 merged commit c6c3927 into rails-api:0-10-stable Jan 10, 2019
@faucct faucct deleted the bugfix/double-evaluation-of-object branch January 10, 2019 18:12
@faucct faucct restored the bugfix/double-evaluation-of-object branch January 10, 2019 18:12
@faucct faucct deleted the bugfix/double-evaluation-of-object branch January 10, 2019 18:13
@faucct faucct restored the bugfix/double-evaluation-of-object branch January 10, 2019 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants