it could be that Boards.find is including other associations so you
might
need to write something like @running = Boards.find(:all, :conditions => “running = 1”, :order => "
boards.priority ASC, quantity DESC")
though looking at your pasted code, you have a single quote before the
closing paren (which is missing on 2 of the lines) that was never
opened…that could also be your issue.
That means that it only takes one condition after the :conditions =>…
Is there a simple way of taking 2 conditions…?
Also i have date fields and i was wondering how can i only display the
month and day…? At this moment it displays 2007-01-19 and i want it
to display 01-19…
That means that it only takes one condition after the :conditions =>…
Is there a simple way of taking 2 conditions…?
The :conditions option is simply an SQL fragment that gets inserted into
the SQL WHERE clause, so you can indeed only specify one “condition”.
However, that condition can be anything that is valid in a WHERE clause
… in your case, you would want it to be:
As a side note, specifying the :conditions option as a single string is
fine if you are completely specifying the conditions in your code.
However, if any part of it is coming from user input, you will need to
use the array form of the :conditions option to prevent against SQL
injection. For example: