Commit 42279725 authored by Timothy Andrew's avatar Timothy Andrew

Implement final round of review comments from @DouweM.

Refactor the EE::User module
parent ed94edeb
......@@ -17,13 +17,11 @@ module EE
end
def access_level=(new_level)
new_level = new_level.to_sym
return unless [:admin, :auditor, :regular].include?(new_level)
new_level = new_level.to_s
return unless %w(admin auditor regular).include?(new_level)
self.admin = self.auditor = false
self.admin = true if new_level == :admin
self.auditor = true if new_level == :auditor
self.admin = (new_level == 'admin')
self.auditor = (new_level == 'auditor')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment