Module: Enjoy::Goto

Defined in:
lib/enjoy_cms_goto.rb,
lib/enjoy/goto/admin.rb,
lib/enjoy/goto/engine.rb,
lib/enjoy/goto/version.rb,
lib/enjoy/goto/middleware.rb,
lib/enjoy/goto/configuration.rb,
lib/enjoy/goto/admin/transfer.rb,
app/models/enjoy/goto/transfer.rb,
lib/enjoy/goto/models/transfer.rb,
lib/enjoy/goto/controllers/transfers.rb,
lib/enjoy/goto/models/mongoid/transfer.rb,
app/controllers/enjoy/goto/transfers_controller.rb,
lib/generators/enjoy/goto/config/install_generator.rb

Defined Under Namespace

Modules: Admin, Controllers, Decorators, Models Classes: ConfigGenerator, Configuration, Engine, Middleware, Transfer, TransfersController

Constant Summary collapse

VERSION =
"0.4.1"

Class Method Summary collapse

Class Method Details

.active_record?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/enjoy_cms_goto.rb', line 23

def active_record?
  Enjoy::Goto.orm == :active_record
end

.configObject



6
7
8
# File 'lib/enjoy/goto/configuration.rb', line 6

def self.config
  @configuration ||= Configuration.new
end

.configurationObject



3
4
5
# File 'lib/enjoy/goto/configuration.rb', line 3

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



10
11
12
# File 'lib/enjoy/goto/configuration.rb', line 10

def self.configure
  yield configuration
end

.model_namespaceObject



26
27
28
# File 'lib/enjoy_cms_goto.rb', line 26

def model_namespace
  "Enjoy::Goto::Models::#{Enjoy::Goto.orm.to_s.camelize}"
end

.mongoid?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/enjoy_cms_goto.rb', line 20

def mongoid?
  Enjoy::Goto.orm == :mongoid
end

.ormObject



17
18
19
# File 'lib/enjoy_cms_goto.rb', line 17

def orm
  :mongoid #Enjoy.orm
end

.orm_specific(name) ⇒ Object



29
30
31
# File 'lib/enjoy_cms_goto.rb', line 29

def orm_specific(name)
  "#{model_namespace}::#{name}".constantize
end