Module: Sequel::Plugins::RailsExtensions

Defined in:
lib/sequel/plugins/rails_extensions.rb

Overview

The RailsExtensions plugin adds a single class method to Sequel::Model in order to emulate the behavior of ActiveRecord’s ‘.find` method, where an exception is raised if a record cannot be found by the given id. Here, we raise a ModelNotFoundError, which is rescued in controllers like so:

config.action_dispatch.rescue_responses.merge!(
 'Sequel::Plugins::RailsExtensions::ModelNotFound' => :not_found
)

Defined Under Namespace

Modules: ClassMethods Classes: ModelNotFound