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

Deleter must exist - AR-51 branch - With paranoia gem #32

Open
allhailskippy opened this issue Mar 15, 2018 · 0 comments
Open

Deleter must exist - AR-51 branch - With paranoia gem #32

allhailskippy opened this issue Mar 15, 2018 · 0 comments

Comments

@allhailskippy
Copy link

In the AR-51 branch, when Rails.application.config.active_record.belongs_to_required_by_default is set to true (which it is by default), and when using paranoia v2 for soft deletes, you cannot save the record because it is expecting deleter to be set (which it shouldn't be unless you are deleting it)

Could possibly be fixed by changing lib/active_record/userstamp/stampable.rb line 87 to include the optional: true as part of the merge.

belongs_to :deleter, relation_options.reverse_merge(foreign_key: config.deleter_attribute, optional: true) if associations.third

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

No branches or pull requests

1 participant