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

Fix locking with unsaved changes bug #1340

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mrkrlli
Copy link
Contributor

@mrkrlli mrkrlli commented Sep 9, 2019

@MaicolBen @Tiltorito

@exseniorastronaut
Copy link

@mrkrlli Thank you very much for actually doing it, I couldn't find time to fix my PR :)

Copy link
Collaborator

@MaicolBen MaicolBen left a comment

Choose a reason for hiding this comment

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

thank you!

# At this point restore the attributes so we can obtain the lock
# otherwise an exception is thrown while trying to obtain the lock
# with unsaved data on the resource.
unless const_defined?('Mongoid') do
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

# At this point restore the attributes so we can obtain the lock
# otherwise an exception is thrown while trying to obtain the lock
# with unsaved data on the resource.
@resource.restore_attributes unless const_defined?('Mongoid')
Copy link
Collaborator

@MaicolBen MaicolBen Sep 19, 2019

Choose a reason for hiding this comment

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

It's breaking the specs, I think you have to use defined? instead, const_defined? is with Module.const_defined?("something")

@mrkrlli
Copy link
Contributor Author

mrkrlli commented Oct 29, 2019

@MaicolBen Made the change, sorry it took so long.

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.

3 participants