Sha256: db472cbaac6d27c6b029ebecd1e106b6b3704b2c88b2e4fb8c6f1ac48a0e7543

Contents?: true

Size: 460 Bytes

Versions: 5

Compression:

Stored size: 460 Bytes

Contents

require 'token_master/model'

module TokenMaster
  # Automatically include TokenMaster::Model in Rails/ActiveRecord apps.
  class Railtie < ::Rails::Railtie

    initializer 'token_master.active_record' do
      ActiveSupport.on_load :active_record do
        if Rails::VERSION::MAJOR >= 5
          ::ApplicationRecord.include(TokenMaster::Model)
        else
          ::ActiveRecord::Base.include(TokenMaster::Model)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
token_master-1.0.0 lib/token_master/railtie.rb
token_master-0.1.3 lib/token_master/railtie.rb
token_master-0.1.2 lib/token_master/railtie.rb
token_master-0.1.0 lib/token_master/railtie.rb
token_master-0.0.1 lib/token_master/railtie.rb