8000 Add destroy objects during save by grosendo2006 · Pull Request #87 · rootstrap/yaaf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Conversation

grosendo2006
Copy link
Contributor
@grosendo2006 grosendo2006 commented Jul 8, 2024

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

@grosendo2006 grosendo2006 force-pushed the destroy-objects-during-save branch from bae152a to dc49923 Compare July 8, 2024 15:42
@grosendo2006 grosendo2006 marked this pull request as ready for review July 8, 2024 15:44
@grosendo2006 grosendo2006 changed the title add destroy objects during save Add destroy objects during save Jul 8, 2024
end

it 'returns false' do
expect(subject).to eq false
Copy link
8000 Member

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

Copy link
Contributor Author

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

@grosendo2006 grosendo2006 force-pushed the destroy-objects-during-save branch from dc49923 to 3b565b6 Compare July 8, 2024 16:26
@mwolman
Copy link
8000
mwolman commented Jul 8, 2024

Do any of these changes fix our open issues? @santib you opened those issues, but they don't have a description

@santib
Copy link
Member
santib commented Jul 8, 2024

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

@santib santib merged commit 315356a into master Jul 8, 2024
59 checks passed
@santib santib deleted the destroy-objects-during-save branch July 8, 2024 20:57
@santib
Copy link
Member
santib commented Jul 8, 2024

Great improvement! Thanks 🙌

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
0