Found it. There's a bug in ActiveRecord, but I can get around it. The line "c.list.columns = [:position, :name, :code, :categories] " was causing children categories to be eagerly loaded. This generated the following:
Category Load IDs For Limited Eager Loading (0.8ms) SELECT O.* FROM (SELECT I.*, ROW_NUMBER() OVER () sys_row_num FROM (SELECT DISTINCT tqanda165_category.category_id FROM tqanda165_category WHERE (tqanda165_category.exercise_id = 100) ORDER BY tqanda165_category.position ASC) AS I) AS O WHERE sys_row_num BETWEEN 1 AND 15 This SQL is not generated if eager loading is not needed. I replaced :categories by doing c.columns << :cat_count # <== cat_count_column is defined in the View Helper c.list.columns = [:position, :name, :code, :cat_count] Cheers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
