Module: Devise::Models::WindAuthenticatable::ClassMethods

Defined in:
lib/devise_wind/model.rb

Instance Method Summary collapse

Instance Method Details

#find_by_wind_login_field(login) ⇒ Object



47
48
49
50
# File 'lib/devise_wind/model.rb', line 47

def ()
  # we should create a user here if login was valid but record is missing?
  self.send( ("find_by_" + .to_s).to_sym,  )
end

#find_or_create_by_wind_login_field(login) ⇒ Object



52
53
54
55
56
57
# File 'lib/devise_wind/model.rb', line 52

def ()
  # we should create a user here if login was valid but record is missing
  mname = ("find_or_create_by_" + .to_s)
  Rails.logger.debug "#{self.name}.#{mname}(#{})"
  self.send mname.to_sym, 
end

#validate_wind_login(value = true) ⇒ Object Also known as: validate_wind_login=

Whether or not to validate the wind_login field. If set to false ALL wind validation will need to be handled by you.

  • Default: true

  • Accepts: Boolean



42
43
44
# File 'lib/devise_wind/model.rb', line 42

def (value = true)
  self.validates , :presence => value
end

#wind_host(value = nil) ⇒ Object Also known as: wind_host=



33
34
35
# File 'lib/devise_wind/model.rb', line 33

def wind_host(value=nil)
  configure_property(:wind_host, value)
end

#wind_login_field(value = nil) ⇒ Object Also known as: wind_login_field=, wind_service=

The name of the wind login field in the database.

  • Default: :wind_login, :login, or :username, if they exist

  • Accepts: Symbol



23
24
25
# File 'lib/devise_wind/model.rb', line 23

def (value = nil)
  configure_property(:wind_login_field, value, first_column_to_exist(nil, :wind_login, :login, :username))
end

#wind_service(value = nil) ⇒ Object



28
29
30
# File 'lib/devise_wind/model.rb', line 28

def wind_service(value=nil)
  configure_property(:wind_service, value)
end