Hello,
if (verify_login_id = Login.where(params[:email_address], “active” =>1).select(‘id’)# => [#<Login id: 767>]
verify_admin_id = Admin.where(“login_id” => verify_login_id.first.id).exists? #=> true)
statement
else
raise(ActiveRecord::RecordNotFound.new(“Authorization is required to access this endpoint!”))
end
Syntax correct?
Hello,
if (verify_login_id = Login.where(params[:email_address], "active"
=>1).select('id')# => [#<Login id: 767>]
verify_admin_id = Admin.where("login_id" => verify_login_id.first.id).exists?
#=> true)
statement
else
raise(ActiveRecord::RecordNotFound.new("Authorization is required to
access this endpoint!"))
end
Are you trying to test two things in the if statement?
if (cond1) && (cond2)
# execute if true
else
# execute if false
end