On 15 April 2011 00:07, Seb <[email protected]> wrote: > created_at is stored differently in mysql then in sqlite. > sqlite stores the dates like: 2011-04-14 22:52:52.758612 > and mysql stores the date like: 2011-04-14 22:52:52 (possible rounded) > When I output the date with json formatting, it's returned as > 2011-04-14T22:52:52Z regardless of the underlaying db. But in another part > of my application I request all items with a date newer then the above. > However since "2011-04-14 22:52:52.758612" is bigger then "2011-04-14 > 22:52:52" I get the same item again when I query against sqlite (or > postgresql actually). > In my model I have the following scope defined: scope :since, lambda {|time| > where("updated_at > ?", time) } > which I'm using for getting all news items since a current date.
Are you saying that if you fetch a record and then ask for records where created_at is greater than that records created_at (so no messing with json in between) that you get the same record again. Or using your scope record1 = Model.find( some conditions ) records = Model.since( record1.created_at ) that you get record1 again? Colin -- 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.

