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_parent ⇒ Object
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
25
26
27
|
# File 'lib/fdbq/rails.rb', line 25
def self.latest?
::Rails.version.to_i >= 5
end
|
.model_parent ⇒ Object
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
|