-
Notifications
You must be signed in to change notification settings - Fork 18
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
Create a join model for request issues and decision issues #7886
Create a join model for request issues and decision issues #7886
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - only actionable thing is we probably want to wrap all the db inserts in a transaction.
app/models/rating_issue.rb
Outdated
@@ -47,14 +47,20 @@ def save_decision_issue | |||
# if a DecisionIssue already exists then do not touch it. These should be immutable. | |||
return if decision_issue | |||
|
|||
DecisionIssue.create!( | |||
created_decision_issue = DecisionIssue.create!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably want to wrap the 2 create
calls in a transaction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point sir!
create_table :request_decision_issues do |t| | ||
t.integer :request_issue_id | ||
t.integer :decision_issue_id | ||
t.timestamps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just an observation that we haven't consistently used the AR timestamps on our models. I like doing it, and maybe we should formally endorse that pattern system-wide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always add these. I think they are useful.
This is the first PR for #7884
Description