-
Notifications
You must be signed in to change notification settings - Fork 14
Add destroy objects during save #87
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
Conversation
bae152a
to
dc49923
Compare
end | ||
|
||
it 'returns false' do | ||
expect(subject).to eq false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, wondering why is it even returning false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's because the way I'm initializating the user, I'm not setting the name
so it's returning this error
<ActiveModel::Errors [#<ActiveModel::NestedError attribute=name, type=blank, options={}>]>>
def user
@user ||= User.find_or_initialize_by(email: email)
end
dc49923
to
3b565b6
Compare
Do any of these changes fix our open issues? @santib you opened those issues, but they don't have a description |
no, they are unrelated |
Great improvement! Thanks 🙌 |
Summary
While using this gem, we noticed that if want to delete some models, we don't have a way unless they have a direct relationship (you can see an example here)
So, the idea of this PR is to add the possibility to delete some models using mark_for_destruction, similar to the way rails does with his associations
Other Information