I have one column named bill_date with data type as timestamp without time zone.
Now i want to search a record with the bill_date. The user will enter date as like 2012-12-09.
I want to use Bill.find_by_bill_date(2012-12-09).
The above one will not give result. Because We have to do typecasting. Please give me some suggestions. I don’t want to use where clause or conditions. I want to use find_by only.
You could just add a method to your Bill class like this:
I know you said you didn’t want to use where clauses, but the dynamic finder methods (find_by_*) do the exact same thing, anyway.