Module: Fdbq::Rails

Defined in:
lib/fdbq/rails.rb,
lib/fdbq/rails/engine.rb,
lib/fdbq/rails/helpers.rb,
lib/fdbq/rails/version.rb,
lib/generators/fdbq/rails/install_generator.rb

Defined Under Namespace

Modules: Generators, Helpers Classes: Engine

Constant Summary collapse

VERSION =
'0.1.2'

Class Method Summary collapse

Class Method Details

.controller_parentObject



9
10
11
12
13
14
15
# File 'lib/fdbq/rails.rb', line 9

def self.controller_parent
  if latest?
    'ApplicationController'
  else
    'ActionController::Base'
  end
end

.latest?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/fdbq/rails.rb', line 25

def self.latest?
  ::Rails.version.to_i >= 5
end

.model_parentObject



17
18
19
20
21
22
23
# File 'lib/fdbq/rails.rb', line 17

def self.model_parent
  if latest?
    'ApplicationRecord'
  else
    'ActiveRecord::Base'
  end
end