Ruby multiline condition if statement syntax?

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?

On Fri, May 30, 2014 at 6:25 AM, uorgi poen [email protected] wrote:

end

Are you trying to test two things in the if statement?

if (cond1) && (cond2)
   # execute if true
else
   # execute if false
end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs