mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
user_registered: Return false if user is nil
The return value of user_registered? is only used as boolean. So we can don't need to hande non existent users separately.
This commit is contained in:
parent
e334a6dec3
commit
3e77241f8a
1 changed files with 1 additions and 2 deletions
|
|
@ -119,11 +119,10 @@ class Conference < ActiveRecord::Base
|
|||
# ====Args
|
||||
# * +user+ -> The user we check for
|
||||
# ====Returns
|
||||
# * +nil+ -> If the user doesn't exist
|
||||
# * +false+ -> If the user is registered
|
||||
# * +true+ - If the user isn't registered
|
||||
def user_registered? user
|
||||
return nil if user.nil?
|
||||
return false if user.nil?
|
||||
|
||||
if registrations.where(user_id: user.id).count == 0
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue