Sha256: 706867d27529a551b21df8e0d91dd19fcbbac42513b52b5c96a2b4f1d2fcdb01

Contents?: true

Size: 453 Bytes

Versions: 4

Compression:

Stored size: 453 Bytes

Contents

module SecondBase
  module RailsVersionHelpers

    extend ActiveSupport::Concern

    included { extend RailsVersionHelpers }

    private

    def rails_version
      Rails.version.to(2)
    end

    ['4.0', '4.1', '4.2', '5.0', '5.1'].each do |v|

      vm = v.sub '.', ''

      define_method :"rails_#{vm}?" do
        rails_version == v
      end

      define_method :"rails_#{vm}_up?" do
        rails_version >= v
      end

    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
secondbase-2.2.0 test/test_helpers/rails_version_helpers.rb
secondbase-2.1.6 test/test_helpers/rails_version_helpers.rb
secondbase-2.1.5 test/test_helpers/rails_version_helpers.rb
secondbase-2.1.4 test/test_helpers/rails_version_helpers.rb