Hi. I ran into another weird edge case scenario with dm-aggregates 0.10.. If you run an aggregate count on an unsaved model, it throws a SQL Error on MySQL because it generates a sql command similar to:
SELECT COUNT(*) FROM "posts" WHERE "category_id" IN () Here's a snippet that reproduces the error: http://gist.github.com/193440 You'll need to check the SQL output for the error since the query above runs just fine in Sqlite3. It blows up on MySQL though. Seems like it could be fixed in either dm-aggregates or do_mysql. I sort of think dm-aggregates should check a record for new? before trying to run aggregate queries. Though it also probably makes sense to update do_mysql so it'll never construct queries with empty parenthesis. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" 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/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
