Module: ActiveRecord::Turntable::Util
- Included in:
- FixtureSet
- Defined in:
- lib/active_record/turntable/util.rb
Class Method Summary collapse
- .ar51? ⇒ Boolean
- .ar51_or_later? ⇒ Boolean
- .ar52_or_later? ⇒ Boolean
- .ar_version ⇒ Object
- .ar_version_earlier_than?(version) ⇒ Boolean
- .ar_version_equals_or_later?(version) ⇒ Boolean
- .ar_version_satisfy?(requirement) ⇒ Boolean
- .earlier_than_ar51? ⇒ Boolean
Class Method Details
.ar51? ⇒ Boolean
22 23 24 |
# File 'lib/active_record/turntable/util.rb', line 22 def ar51? ar51_or_later? && !ar52_or_later? end |
.ar51_or_later? ⇒ Boolean
26 27 28 |
# File 'lib/active_record/turntable/util.rb', line 26 def ar51_or_later? ar_version_equals_or_later?("5.1") end |
.ar52_or_later? ⇒ Boolean
34 35 36 |
# File 'lib/active_record/turntable/util.rb', line 34 def ar52_or_later? ar_version_equals_or_later?("5.2") end |
.ar_version ⇒ Object
11 12 13 |
# File 'lib/active_record/turntable/util.rb', line 11 def ar_version ActiveRecord.gem_version.release end |
.ar_version_earlier_than?(version) ⇒ Boolean
7 8 9 |
# File 'lib/active_record/turntable/util.rb', line 7 def ar_version_earlier_than?(version) ar_version < Gem::Version.new(version) end |
.ar_version_equals_or_later?(version) ⇒ Boolean
3 4 5 |
# File 'lib/active_record/turntable/util.rb', line 3 def ar_version_equals_or_later?(version) ar_version >= Gem::Version.new(version) end |
.ar_version_satisfy?(requirement) ⇒ Boolean
15 16 17 18 19 20 |
# File 'lib/active_record/turntable/util.rb', line 15 def ar_version_satisfy?(requirement) unless requirement.is_a?(Gem::Requirement) requirement = Gem::Requirement.new(requirement) end requirement.satisfied_by?(ar_version) end |
.earlier_than_ar51? ⇒ Boolean
30 31 32 |
# File 'lib/active_record/turntable/util.rb', line 30 def earlier_than_ar51? ar_version_earlier_than?("5.1") end |