Module: Reusable::Rails::Controllers::MissingRecordHandler

Extended by:
ActiveSupport::Concern
Defined in:
lib/reusable/rails/controllers/missing_record_handler.rb

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

append_features, extended, included

Instance Method Details

#record_not_foundObject

Helper method to ensure the proper error is always raised. This should be called when throwing a not found error instead of invoking the error directly.

(see #render_404)

Raises:

  • (ActiveRecord::RecordNotFound)


27
28
29
# File 'lib/reusable/rails/controllers/missing_record_handler.rb', line 27

def record_not_found
  raise ActiveRecord::RecordNotFound
end