Skip to content

Commit 9ade5ef

Browse files
use will_save_change_to_attribute?
1 parent da8bf28 commit 9ade5ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/redmine_sudo/patches/user_patch.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ def update_sudoer
6565
return if sudoer? || !admin?
6666

6767
# if suoder is disabled, admin is also disabled
68-
if sudoer_changed? && !admin_changed?
68+
if will_save_change_to_sudoer? && !will_save_change_to_admin?
6969
self.admin = false
70-
elsif new_record? || admin_changed?
70+
elsif new_record? || will_save_change_to_admin?
7171
# only used for api
7272
self.sudoer = true
7373
end

0 commit comments

Comments
 (0)