rails 4 how ro remove the limit condition from sqlite -


I have a table for the question and I want to show only current user questions in the index page so that I can do it :

  question.fund_b_user_id current.id   

but it only returns 1 record with this ID. When I looked in the generated sqlite code I found this

  SELECT "questions". * "Question" Where "Question" "User_id" = 2 LIMIT 1   

So I delete this limit or zero

find_by always matches a single record with the given conditions. Instead use the find_all_by or where

  question. (User_id: current_user.id)    

OR

  / pre> 

I suggest you to use where .

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

sql server ce - Is there some way to make sqlce3.5 and 4.0 co-exist in the C# project -