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

🎁 Add transaction for set_child_flag #321

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

kirkkwang
Copy link
Contributor

This commit will add a transaction for the set_child_flag functionality that used to use a after_save callback for Valkyrie objects.

This commit will add a transaction for the set_child_flag functionality
that used to use a after_save callback for Valkyrie objects.
it 'sets the is_child flag on the child work' do
allow(::User).to receive(:find_by_user_key).and_return('user')
expect(child_work.is_child).to be nil
subject
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
subject
expect { subject }.to change { Hyrax.query_service.find_by(id: child_work.id).is_child }.to(true)

@jeremyf jeremyf merged commit 81180a3 into main Jan 24, 2024
9 of 10 checks passed
@kirkkwang kirkkwang deleted the rails_hyrax_upgrade_set_child_flag_transaction branch January 24, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants