style: if ! changed by unless
- if ! changed by unless as it is more readable - !object.blank? is equivalent to object.present?, also more readable
This commit is contained in:
parent
96155eb87f
commit
7e5d20c89d
18 changed files with 27 additions and 28 deletions
|
|
@ -52,7 +52,7 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
ahoy.track 'Registered', title: 'New registration'
|
||||
|
||||
# Sign in the new user
|
||||
if !current_user
|
||||
unless current_user
|
||||
sign_in(@registration.user)
|
||||
end
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
|
||||
def set_registration
|
||||
@registration = Registration.find_by(conference: @conference, user: current_user)
|
||||
if !@registration
|
||||
unless @registration
|
||||
redirect_to new_conference_conference_registration_path(@conference.short_title),
|
||||
error: "Can't find a registration for #{@conference.title} for you. Please register."
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue