Sha256: f3ac5dcb310c82add7f745f7143ed607914321240318adf9fb199ff60627ce43

Contents?: true

Size: 683 Bytes

Versions: 14

Compression:

Stored size: 683 Bytes

Contents

module ActiveRecord::Turntable
  module Util
    extend self

    def ar_version_equals_or_later?(version)
      ar_version >= Gem::Version.new(version)
    end

    def ar_version_earlier_than?(version)
      ar_version < Gem::Version.new(version)
    end

    def ar4?
      ActiveRecord::VERSION::MAJOR == 4
    end

    def ar41_or_later?
      ar_version_equals_or_later?("4.1")
    end

    def earlier_than_ar41?
      ar_version_earlier_than?("4.1")
    end

    def ar42_or_later?
      ar_version_equals_or_later?("4.2")
    end

    def earlier_than_ar42?
      ar_version_earlier_than?("4.2")
    end

    def ar_version
      ActiveRecord::gem_version
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
activerecord-turntable-2.5.0 lib/active_record/turntable/util.rb
activerecord-turntable-2.4.0 lib/active_record/turntable/util.rb
activerecord-turntable-2.3.3 lib/active_record/turntable/util.rb
activerecord-turntable-2.3.2 lib/active_record/turntable/util.rb
activerecord-turntable-2.3.1 lib/active_record/turntable/util.rb
activerecord-turntable-2.3.0 lib/active_record/turntable/util.rb
activerecord-turntable-2.2.2 lib/active_record/turntable/util.rb
activerecord-turntable-2.2.1 lib/active_record/turntable/util.rb
activerecord-turntable-2.2.0 lib/active_record/turntable/util.rb
activerecord-turntable-2.1.1 lib/active_record/turntable/util.rb
activerecord-turntable-2.1.0 lib/active_record/turntable/util.rb
activerecord-turntable-2.1.0.rc2 lib/active_record/turntable/util.rb
activerecord-turntable-2.1.0.rc1 lib/active_record/turntable/util.rb
activerecord-turntable-2.1.0.beta2 lib/active_record/turntable/util.rb