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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -