diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-20 08:59:43 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-20 08:59:43 +0000 |
commit | d5a943fd132c95dde1874ed6404403d5c04fdd12 (patch) | |
tree | f53c4b46c90d7bfbadaee90ab745a6017dcee47c /app/models/role.rb | |
parent | 202285ea8b576ec38965174a589a5654896660d9 (diff) | |
download | redmine-d5a943fd132c95dde1874ed6404403d5c04fdd12.tar.gz redmine-d5a943fd132c95dde1874ed6404403d5c04fdd12.zip |
Merged r16049 (#24156).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16093 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/role.rb')
-rw-r--r-- | app/models/role.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/role.rb b/app/models/role.rb index 86fe73070..acf71c50e 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -279,9 +279,9 @@ private end def self.find_or_create_system_role(builtin, name) - role = where(:builtin => builtin).first + role = unscoped.where(:builtin => builtin).first if role.nil? - role = create(:name => name) do |r| + role = unscoped.create(:name => name) do |r| r.builtin = builtin end raise "Unable to create the #{name} role (#{role.errors.full_messages.join(',')})." if role.new_record? |