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

Force validation for updating instructorship.instructor_id when merging ... #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Force validation for updating instructorship.instructor_id when merging ... #48

wants to merge 1 commit into from

Conversation

jasonkhoe
Copy link
Contributor

...instructors

May partly or fully address https://hkn.eecs.berkeley.edu/redmine/issues/544

@@ -57,7 +57,7 @@ def eat(victims)

things.each do |thing|
puts " updating #{thing.inspect}"
raise "Failed update" unless thing.update_attribute(:instructor_id, self.id)
raise "Failed update" unless thing.update_attributes(:instructor_id => self.id)
Copy link
Member

Choose a reason for hiding this comment

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

#update_attributes! will raise an exception if validation fails, so you can just use that.

Also, unrelated to this change, but we really shouldn't be putting random print statements in the code like on line 59.

Other nitpick unrelated to this change: def eat(victims)? Really?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was quite amused by the usage of "things" as a variable name, made it really clear what I was looking at...

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