Skip to content

Commit

Permalink
Fix for using new find_safely (#5109)
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders authored Feb 4, 2025
1 parent a9b62bc commit 1a7b606
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/notification_configurations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ def destroy
helper_method :import_threshold

def notification_configuration
@notification_configuration ||= GrdaWarehouse::NotificationConfiguration.find_safely(params[:id]) ||
@notification_configuration ||= if params[:id].present?
GrdaWarehouse::NotificationConfiguration.find_safely(params[:id])
else
GrdaWarehouse::NotificationConfiguration.new(
source: import_threshold,
notification_slug: import_threshold.valid_notification_slug(params[:notification_slug]),
)
end
end
helper_method :notification_configuration
end

0 comments on commit 1a7b606

Please sign in to comment.