Browse Source

Merge pull request #153 from GovSciences/active_record_fixes

Load ActiveRecord functionality only if ActiveRecord itself is loaded
master
Dmitrii Golub 6 years ago committed by GitHub
parent
commit
dd2ccc8b43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      lib/two_factor_authentication.rb
  2. 2
      lib/two_factor_authentication/orm/active_record.rb

3
lib/two_factor_authentication.rb

@ -2,7 +2,6 @@ require 'two_factor_authentication/version'
require 'devise'
require 'active_support/concern'
require "active_model"
require "active_record"
require "active_support/core_ext/class/attribute_accessors"
require "cgi"
@ -47,7 +46,7 @@ end
Devise.add_module :two_factor_authenticatable, :model => 'two_factor_authentication/models/two_factor_authenticatable', :controller => :two_factor_authentication, :route => :two_factor_authentication
require 'two_factor_authentication/orm/active_record'
require 'two_factor_authentication/orm/active_record' if defined?(ActiveRecord::Base)
require 'two_factor_authentication/routes'
require 'two_factor_authentication/models/two_factor_authenticatable'
require 'two_factor_authentication/rails'

2
lib/two_factor_authentication/orm/active_record.rb

@ -1,3 +1,5 @@
require "active_record"
module TwoFactorAuthentication
module Orm
module ActiveRecord

Loading…
Cancel
Save