Class: Authlogic::ActsAsAuthentic::Queries::FindWithCase Private

Inherits:
Object
  • Object
show all
Defined in:
lib/authlogic/acts_as_authentic/queries/find_with_case.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The query used by public-API method ‘find_by_smart_case_login_field`.

Constant Summary collapse

AR_GEM_VERSION =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Dup ActiveRecord.gem_version before freezing, in case someone else wants to modify it. Freezing modifies an object in place. github.com/binarylogic/authlogic/pull/590

::ActiveRecord.gem_version.dup.freeze

Instance Method Summary collapse

Constructor Details

#initialize(model_class, field, value, sensitive) ⇒ FindWithCase

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FindWithCase.



15
16
17
18
19
20
# File 'lib/authlogic/acts_as_authentic/queries/find_with_case.rb', line 15

def initialize(model_class, field, value, sensitive)
  @model_class = model_class
  @field = field.to_s
  @value = value
  @sensitive = sensitive
end

Instance Method Details

#executeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
# File 'lib/authlogic/acts_as_authentic/queries/find_with_case.rb', line 23

def execute
  @model_class.where(comparison).first
end