Class: Rails::Couchbase::Railtie

Inherits:
Railtie
  • Object
show all
Defined in:
lib/couchbase/railtie.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.generatorSymbol

Determine which generator to use. app_generators was introduced after 3.0.0.

Examples:

Get the generators method.

railtie.generators

Returns:

  • (Symbol)

    The method name to use.

Since:

  • 0.1.0



38
39
40
# File 'lib/couchbase/railtie.rb', line 38

def self.generator
  config.respond_to?(:app_generators) ? :app_generators : :generators
end

.rescue_responsesHash

Maping of rescued exceptions to HTTP responses

Examples:

railtie.rescue_responses

Returns:

  • (Hash)

    rescued responses

Since:

  • 0.1.0



50
51
52
53
54
55
56
# File 'lib/couchbase/railtie.rb', line 50

def self.rescue_responses
  {
    'Couchbase::Error::NotFound' => :not_found,
    'Couchbase::Error::NotStored' => :unprocessable_entity,
    'Couchbase::Error::RecordInvalid' => :unprocessable_entity
  }
end