Closed alubbe closed 11 years ago
I am not an expert on activerecord yet, but here is my hunch: in json/model.rb, the all_json method is constructed in such a way that it expects to be called after "where". This disables all_json being called after any chain of activerecord methods. This could be circumvented by expanding the string inside where() but it goes against rails' readability. It would be great if you could dig deeper to see if it is possible to fix without too much hassle; if I can help you in any way, let me know!
all_json available on an ActiveRecord class or scope chain. first(30) actually fires the query and returns ActiveRecord objects. What you want is to replace first(30) with limit(30).
The following code
breaks with the following error
Could you take a look into this? Thanks!