You should probably convert closing_date to a datetime datatype in the DB if
possible:

script/generate migration change_closing_date
... in the migration ...
change_column :jobs, :closing_date, :datetime


Otherwise you might try:

# add ' and consistent formating
@jobs = Job.find(:all, :conditions =>
"'#{Date.parse(str="#{closing_date}").to_s(:db)}' >=
'#{Date.today.to_s(:db)}'")



On Wed, Feb 24, 2010 at 5:48 AM, Pale Horse <[email protected]> wrote:

> > @jobs = Job.find(:all, :conditions =>
> "#{Date.parse(str="#{closing_date}")} >=
> #{Date.today.strftime("%d/%m/%Y")}")
>
> In the above instance, 'closing_date' is a string. I want to ensure that
> only instances of Job where the closing date is greater than or equal to
> today's date are pulled into an array.
>
> Please can someone rectify this code; I'm not sure where it's going
> wrong.
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to