Module: Devise::Models::GoogleAuthenticatable::GauthEnabledInstanceMethod

Defined in:
lib/devise_gauth/models/google_authenticatable.rb

Instance Method Summary collapse

Instance Method Details

#gauth_enabled?Boolean

Returns:

  • (Boolean)


80
81
82
83
84
85
86
87
88
89
# File 'lib/devise_gauth/models/google_authenticatable.rb', line 80

def gauth_enabled?
  # Active_record seems to handle determining the status better this way
  if gauth_enabled.respond_to?('to_i')
    gauth_enabled.to_i != 0
  # Mongoid does NOT have a .to_i for the Boolean return value, hence,
  # we can just return it
  else
    gauth_enabled
  end
end