Forum: Ruby on Rails Ruby multiline condition if statement syntax?

E1c2f0ff0f342bb13e86c2476d417297?d=identicon&s=25 uorgi poen (Guest)
on 2014-05-30 14:23
(Received via mailing list)
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?
Aa082c8b00a50928e5860dcd70bf2368?d=identicon&s=25 tamouse m. (tamouse_m)
on 2014-05-31 14:10
(Received via mailing list)
On Fri, May 30, 2014 at 6:25 AM, uorgi poen <ggstack12@gmail.com> wrote:

> end
>

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

    if (cond1) && (cond2)
       # execute if true
    else
       # execute if false
    end
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.