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? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.