Sha256: 43c96c983006d3abeb5441d312ab7031b19a518be087fa27a8b812142cefdb66

Contents?: true

Size: 445 Bytes

Versions: 2

Compression:

Stored size: 445 Bytes

Contents

module ThirdBase
  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'].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

2 entries across 2 versions & 1 rubygems

Version Path
thirdbase-2.1.2 test/test_helpers/rails_version_helpers.rb
thirdbase-2.1.1 test/test_helpers/rails_version_helpers.rb