Ruby on Rails Saturday, May 31, 2014




On Fri, May 30, 2014 at 6:25 AM, uorgi poen <ggstack12@gmail.com> wrote:
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

 

Syntax correct?


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5ac436a3-d03c-488c-841c-f3a38240bdb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t8iQRwfVe77juP%2BFRnJXwA2fCTJ17iMMMPsFQ14dNqRpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment