Displaying 2 results from an estimated 2 matches for "day_of_week".
Did you mean:
days_of_week
2008 Jun 23
1
Find_by_sql Doesn't Return Attributes?
My find_by_sql is not returning attributes of the calling model class.
Thermo.find_by_sql("SELECT COUNT(*) FROM thermo WHERE thermo_loc =
''back'' GROUP BY DAYOFWEEK(time_on) ASC")
# ==> [#<Thermo >, #<Thermo >, #<Thermo >, #<Thermo >, #<Thermo >,
#<Thermo >, #<Thermo >]
The sql is fine and when I checked it in a mysql
2005 Mar 09
21
Converting time retrieved from MySQL
I''m having a problem converting a date retrieved from my MySQL database
and I''m hoping someone can help.
MySQL stores the date/time as this:
2005-03-08 17:00:34.0
and according to my Pickaxe book Ruby stores times as "the number of
seconds and microseconds since [...] January 1, 1970". All well and good.
Unfortunately, RoR is converting my date to this: