Module: Mobility::Plugins::ActiveRecord::Backend

Extended by:
Mobility::Plugin
Defined in:
lib/mobility/plugins/active_record/backend.rb

Overview

Maps backend names to ActiveRecord namespaced backends.

Instance Method Summary collapse

Methods included from Mobility::Plugin

configure, configure_default, default, dependencies, dependencies_satisfied?, included, included_hook, initialize_hook, requires

Instance Method Details

#load_backend(backend) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mobility/plugins/active_record/backend.rb', line 16

def load_backend(backend)
  if Symbol === backend
    require "mobility/backends/active_record/#{backend}"
    Backends.load_backend("active_record_#{backend}".to_sym)
  else
    super
  end
rescue LoadError => e
  raise unless e.message =~ /active_record\/#{backend}/
  super
end