Skip to content

Commit

Permalink
refactor: use present? instead of nil?
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrigoriev8109 committed Dec 25, 2024
1 parent 671f62a commit 2454e2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/concerns/attachment_manageable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ def allow_only_one_attachment
end

def show_alert_if_attachment_missing
if !params[:pet][:images].nil?
if params[:pet][:images].present?
no_empty_images = params[:pet][:images].reject { |image| image == "" }
elsif !params[:pet][:files].nil?
elsif params[:pet][:files].present?
no_empty_files = params[:pet][:files].reject { |image| image == "" }
end

Expand Down

0 comments on commit 2454e2d

Please sign in to comment.