projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
696bbd1
)
Refactor set_default_assigned_role to be more easily read.
author
Andy Allan
<git@gravitystorm.co.uk>
Wed, 14 Mar 2018 09:35:58 +0000
(17:35 +0800)
committer
Andy Allan
<git@gravitystorm.co.uk>
Wed, 14 Mar 2018 09:35:58 +0000
(17:35 +0800)
app/models/issue.rb
patch
|
blob
|
history
diff --git
a/app/models/issue.rb
b/app/models/issue.rb
index 00ee934f7a0fe430d1b54720fb85837e948206ab..c02254a1b4b1cf3743bc5a1e7503fc124dea3de6 100644
(file)
--- a/
app/models/issue.rb
+++ b/
app/models/issue.rb
@@
-95,7
+95,11
@@
class Issue < ActiveRecord::Base
end
def set_default_assigned_role
- role = %w[Note].include?(reportable.class.name) ? "moderator" : "administrator"
- self.assigned_role = role if assigned_role.blank?
+ if assigned_role.blank?
+ self.assigned_role = case reportable
+ when Note then "moderator"
+ else "administrator"
+ end
+ end
end
end