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:
Ana 2016-08-06 00:57:07 +02:00
parent 96155eb87f
commit 7e5d20c89d
18 changed files with 27 additions and 28 deletions

View file

@ -103,7 +103,7 @@ module Admin
comment.commentable = @event
comment.user_id = current_user.id
comment.save!
if !params[:parent].nil?
unless params[:parent].nil?
comment.move_to_child_of(params[:parent])
end
@ -202,7 +202,7 @@ module Admin
def get_event
@event = @conference.program.events.find(params[:id])
if !@event
unless @event
redirect_to admin_conference_program_events_path(conference_id: @conference.short_title),
error: 'Error! Could not find event!'
return