This project is archived and is in readonly mode.
SQL error on Postgress
Reported by Trey Spiva | April 23rd, 2010 @ 03:11 PM
I am getting an PGError when using the following code snippet to search for all records that have an expirationDate greater than today.
campaigns = Table(:users)
campaigns.where(campaigns[:expirationDate].gt(Date.today.midnight))
According to this error it looks like the '*' is missing between the select and from.
ActionView::Template::Error (PGError: ERROR: syntax error at or
near "FROM"
LINE 1: SELECT FROM "users" WHERE "users"."expiration...
^
: SELECT FROM "users" WHERE "users"."expirationDate" > '2010-04-22 06:00:00.000000')
Comments and changes to this ticket
-
Ryan Bigg April 25th, 2010 @ 12:18 AM
- State changed from new to open
Could you submit a failing test case for this issue please?
-
Trey Spiva April 26th, 2010 @ 04:13 PM
It turns out that I made a mistake in my code. The name of the table was incorrect. Sorry for the mistake.
-
Ryan Bigg April 26th, 2010 @ 09:26 PM
- State changed from open to invalid
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>