-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to find_or_create_by after code review
Jeremy pointed out during code review that it might be worth using find_or_create_by in the Term methods, rather than a combination of the create method and a guard method in the Detection model. This makes that change, adopting find_or_create_by inside Term and removing the check_for_current method from the Detection model. Along the way we update the specific assertion being looked for in the Detection tests. Please note that there are tests in the Term model that confirm the record_* methods an be called repeatedly without either creating duplicate records, or throwing errors.
- Loading branch information
1 parent
48ef85b
commit aa746f6
Showing
3 changed files
with
6 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters