Skip to content

[257] Add suite unmerging - #594

Open
esoterik wants to merge 1 commit into
masterfrom
257_unmerge
Open

[257] Add suite unmerging#594
esoterik wants to merge 1 commit into
masterfrom
257_unmerge

Conversation

@esoterik

Copy link
Copy Markdown
Collaborator

Resolves #257

  • Adds SuiteUnmerger
  • Adds original suite attribute to rooms
  • Adds Room#store_original_suite!

Resolves #257
  - Adds SuiteUnmerger
  - Adds original suite attribute to rooms
  - Adds Room#store_original_suite!
result = described_class.submit(suite: suite, params: params)
expect(result[:object].draws.map(&:id)).to include(draw.id)
end
it 'calls :store_original_suite! on the rooms' do

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@orenyk I have no idea why this is failing.

Comment thread app/models/room.rb
# @params [Hash] attrs Other attributes to update
#
# @return [Boolean] Whether or not the update was successful
def store_original_suite!(**attrs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What would happen if a suite is merged, unmerged, merged again, then unmerged again? It seems like the suite would be left with outdated info in the :original_suite attribute.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We want the original suite to always be the first suite the rooms belongs into, so once this attribute is set it shouldn't change.

In that scenario, original_suite would always be the room's first suite, not any of the ones that it belonged to during previous merges.

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