kohana/orm — pull request #87 by Archmonster (2013-07-27 20:10:37+00:00)
Title: Make count_all use table_name.primary_key instead of just primary_key

ORM::factory('Table1')->with('table2')->count_all() would generate invalid query if both table1 and table2 has it's primary key set to the same value. Primary key would be ambiguous in the generated SQL.