summaryrefslogtreecommitdiffstats
path: root/app/models/role.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-05 13:42:00 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-05 13:42:00 +0000
commit3758b91e5493a9c55de174f5ea1c6a0ac2a864ca (patch)
tree84a14ac79267e117578e20e305f77a5953f484b7 /app/models/role.rb
parent78d3c05aa0053e46ce194294ae54d662bf0a2a76 (diff)
downloadredmine-3758b91e5493a9c55de174f5ea1c6a0ac2a864ca.tar.gz
redmine-3758b91e5493a9c55de174f5ea1c6a0ac2a864ca.zip
add empty line after guard clause to app/models/role.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20260 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/role.rb')
-rw-r--r--app/models/role.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/role.rb b/app/models/role.rb
index c2159eeb1..7b097f47d 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -108,6 +108,7 @@ class Role < ActiveRecord::Base
# Copies attributes from another role, arg can be an id or a Role
def copy_from(arg, options={})
return unless arg.present?
+
role = arg.is_a?(Role) ? arg : Role.find_by_id(arg.to_s)
self.attributes = role.attributes.dup.except("id", "name", "position", "builtin", "permissions")
self.permissions = role.permissions.dup
@@ -133,6 +134,7 @@ class Role < ActiveRecord::Base
def remove_permission!(*perms)
return unless permissions.is_a?(Array)
+
permissions_will_change!
perms.each { |p| permissions.delete(p.to_sym) }
save!