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

Handle Ordering of Templates When "No research organization" Box is Checked #718

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

aaronskiba
Copy link
Collaborator

Fixes #685

Changes proposed in this PR:

Commit d127444 implemented the template sorting as described here: #685

However, the fix did not address the template sorting when "No research organization associated with this plan or my research organization is not listed" is checked. This commit does.
`@templates = @templates.uniq` is executed in line 69. Thus, `@templates = @templates.flatten.uniq` would be redundant in line 57.
end
@templates = @templates.flatten
Copy link
Collaborator Author

@aaronskiba aaronskiba Apr 10, 2024

Choose a reason for hiding this comment

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

I would've called @templates = @templates.flatten.uniq at the end of the else block. But because it already exists in the if block as well, I just moved it outside of the blocks to avoid redundancy (and the rubocop offense).

I also changed @templates = @templates.flatten.uniq to @templates = @templates.flatten. @templates = @templates.uniq gets called at the end of the controller action, so calling .uniq again on line 57 would have been redundant.

Copy link
Collaborator

@200455939-yashu 200455939-yashu left a comment

Choose a reason for hiding this comment

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

Good work 🥳

@aaronskiba aaronskiba merged commit 68edd61 into integration Apr 11, 2024
13 checks passed
@aaronskiba aaronskiba deleted the aaron/issues/685 branch April 11, 2024 14:53
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.

2 participants