This project is archived and is in readonly mode.
Improve test coverage and add :having option to finder, hm and habtm.
Reported by Emilio Tagua | September 11th, 2008 @ 09:10 PM | in 2.x
This patch is divided in 3 parts:
- Improve test coverage when using option :group in find. There were no tests in finder using this option.
- Add the option :having to finder, to be used in combination with the :group option. So it can be used in a SELECT statement to filter the records that a GROUP BY returns.
- Include :having in has_many and has_and_belongs_to_many scope since both can use the option :group and therefore having can be very helpful in some situations when filtering records.
Added tests and docs that covers all new features.
Comments and changes to this ticket
-
Emilio Tagua September 11th, 2008 @ 09:44 PM
Test coverage in a single patch file so it can be applied separately from the one adding :having option.
-
Emilio Tagua September 11th, 2008 @ 11:17 PM
- Assigned user set to Michael Koziarski
Modified tests and relationships so the test can also work on postgres.
Tested mysql, postgres and sqlite3.
-
Emilio Tagua September 12th, 2008 @ 02:26 PM
Since the test coverage improvement was commited i created a single patch for adding the :having option to find, hm and habtm associations.
Also tested on mysql, postgres and sqlite3.
-
Emilio Tagua November 21st, 2008 @ 10:23 PM
Michael,
After applying the patch with test coverage improvement, you told me to hold adding the option having to finders until Rails 2.2 was out.
That time as come, so i rebased the diff to master.
Tested on mysql, postgres and sqlite3.
-
Repository December 1st, 2008 @ 07:23 PM
- State changed from new to committed
(from [97403ad5fdfcdfb2110c6f8fd0ebf43b7afc4859]) Add :having option to find, to use in combination with grouped finds. Also added to has_many and has_and_belongs_to_many associations.
Signed-off-by: Michael Koziarski michael@koziarski.com [#1028 state:committed] http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1028 Improve test coverage and add :having option to finder, hm and habtm. Signed-off-by: Michael Koziarski michael@koziarski.com [#...