app/controllers/users_controller.rb
## we will have to refactor this later.
we will have to refactor this later.
we will have to refactor this later .
def check_password(user, params)
        params.require(:email)
        user_params.each { |k, v| user.send("#{k}=", v) }
        puts "------------- check password "
        puts user_params.inspect
        puts "-----------------------------------"
        return true if params[:without_password] == 'true'
        if params.has_key?(:current_password)
            user.password = params[:current_password]
            if user = user.find_by_email_password
                return true
            else
                return false
            end
        end
    end
def check_password ( user , params ) params . require ( :email ) user_params . each { | k , v | user . send ( "#{k}=" , v ) } puts "------------- check password " puts user_params . inspect puts "-----------------------------------" return true if params [ :without_password ] == 'true' if params . has_key? ( :current_password ) user . password = params [ :current_password ] if user = user . find_by_email_password return true else return false end end end
we will have to refactor this later.
we will have to refactor this later .
user
params