Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/admin/forest_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Admin::ForestController < ApplicationController

after_action :verify_authorized, unless: :devise_controller?

rescue_from ActiveRecord::InvalidForeignKey, with: :foreign_key_contraint
rescue_from ActiveRecord::InvalidForeignKey, with: :foreign_key_constraint
rescue_from ActiveRecord::RecordNotUnique, with: :record_not_unique

# rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
Expand Down Expand Up @@ -78,7 +78,7 @@ def record
instance_variable_get("@#{controller_name.singularize}")
end

def foreign_key_contraint(exception)
def foreign_key_constraint(exception)
if record
statusable_message = record.try(:statusable?) ? ' Alternatively, you may want to set this record\'s status to hidden instead.' : ''
error_messages = ["This record can't be deleted because another record depends on it. First remove the association to the other record before deleting this one.#{statusable_message}", "<code>#{exception.message}</code>"]
Expand Down