I am upgrading rail applications from 2.2.2 to 2.3.5. Only the remaining error occurs when I call total_entries
to create a jqgrid.
Error:
NoMethodError (# & undefined method lt `total_entries'; Array: 0xbbe 9ab0 & gt;)
code snippet:
@route = Route.find (: all ,: conditions = & gt; "id (# {Params [: id]})") {if Paramoj [page ] .Displayed? Then Pageant: Page = & gt; Param [: page],: per page = & gt; Parameters [: rows] "# {Params [: sidx]} # {params [: sord]}" to end the response} by order #. Format | Format.html # show.html.erb format.xml {Render: xml = & gt; @ Routing} format.json {render: jason = & gt; @ Routing} format.jgrid {render: json = & gt; @ Route. To_jqgrid_json ([: id ,: name], Params [: page] Params [rows] @ Margtotl_entryjh}} and
Any ideas? Thanks!
Edit
I'm working on removing the block used after search
. I used the Squirrel plugin order_by
had to be moved because I was getting an undefined method call for it.
I am not sure that it is less dry Is there a better way to do this with the previous code in Rail 2.3.5, Will_Pignet, and Squirrels using conditions
in more than one place?
If parameter [: page] Kpradrshit? re @ routing = root: Prishtagnet: conditions = & gt; "id (# {parameter [: id]})" ,: p = & gt; Param [: page] ,: per page = & gt; Pram [: Lines] ,: order = & gt; "# {Params [: sidx]}` # {params [: sord]} "and @ routing = root. Remove (: All,: position => id (# { Params [: id]}} ")
2 edit
Another possibility for this error is that I do Rails Using Ruby 1.8.7 with 2.2.2 was now using Ruby 1.9.1 with Rail 2.3.5. Has there been any major change between 1.8.7 and 1.9.1 that will stop the block after not getting the active record to run?
In Rail 2.3.5, return one array (one, all, ...) in the call will come and normally a custom forms with them are not relevant as you can get with a scope to have a block to find a call is a little irregular and may be part of the problem.
You can fix this by making an opportunity that is what you want:
class path & lt; ActiveRecord :: Base named_scope: with_ids, lambda {| * ID | {: Terms = & gt; {: Id = & gt; Ids.flatten}}}
Then you can use the radius instead:
@routes = route.with_ids (params [: id] )
Comments
Post a Comment