ruby on rails - devise signin using username or email -


below model. can explain me purpose of attr_accessor: signin here ?. have seen posts here stating attr_accessor creates getter , setters.

class user < activerecord::base   # include default devise modules. others available are:   # :confirmable, :lockable, :timeoutable , :omniauthable   devise :database_authenticatable, :registerable,          :recoverable, :rememberable, :trackable, :validatable    attr_accessor :signin end 

in devise.rb file, have this.

config.authentication_keys = [ :signin ] 

questions:

  1. can explain me purpose of attr_accessor: signin here ?.
  2. what config.authentication_keys = [ :signin ] lead in device.rb file?.

this option enables pick authentication key. telling devise use accessor signin (that declared above).

default 1 used email:

config.authentication_keys = [ :email ]   

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -