Class: Rails::Mongoid::Railtie
- Defined in:
- lib/mongoid/railtie.rb
Overview
:nodoc:
Class Method Summary collapse
-
.generator ⇒ Symbol
Determine which generator to use.
-
.rescue_responses ⇒ Object
Maping of rescued exceptions to HTTP responses.
Class Method Details
.generator ⇒ Symbol
Determine which generator to use. app_generators was introduced after 3.0.0.
22 23 24 |
# File 'lib/mongoid/railtie.rb', line 22 def self.generator config.respond_to?(:app_generators) ? :app_generators : :generators end |
.rescue_responses ⇒ Object
Maping of rescued exceptions to HTTP responses
@ return [Hash] rescued responses
34 35 36 37 38 39 |
# File 'lib/mongoid/railtie.rb', line 34 def self.rescue_responses { "Mongoid::Errors::DocumentNotFound" => :not_found, "Mongoid::Errors::Validations" => 422 } end |