mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
Remove useless assignments to changed before the unconditional changed = true at the password block. Also fix ||= short-circuit bug that skipped ensure_attr! when changed was already true. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec98dfbe46
commit
db3df8ec53
1 file changed
+2
-3
@@ -50,13 +50,12 @@ if user
|
||||
changed = true
|
||||
end
|
||||
|
||||
changed ||= ensure_attr!(user, :provider, "greenlight")
|
||||
changed ||= ensure_attr!(user, :language, "en")
|
||||
ensure_attr!(user, :provider, "greenlight")
|
||||
ensure_attr!(user, :language, "en")
|
||||
|
||||
if user.respond_to?(:role=) && user.respond_to?(:role_id)
|
||||
if user.role_id != admin_role.id
|
||||
user.role = admin_role
|
||||
changed = true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user