Commit Graph

4604 Commits

Author SHA1 Message Date
Jon Leighton
9ec0734874 Properly support conditions on any of the reflections involved in a nested through association 2010-10-19 00:27:40 +01:00
Jon Leighton
78b8c51cb3 Refactoring: replace the mix of variables like @finder_sql, @counter_sql, etc with just a single scope hash (created on initialization of the proxy). This is now used consistently across all associations. Therefore, all you have to do to ensure finding/counting etc is done correctly is implement the scope correctly. 2010-10-17 23:29:56 +01:00
Jon Leighton
edc176d33b Make sure nested through associations are read only 2010-10-15 17:46:09 +01:00
Jon Leighton
d619e39938 Fix small bug which was shown by the last commit 2010-10-15 16:27:13 +01:00
Jon Leighton
1e2525bfe0 Add assertions for nested through associations loaded by includes with conditions (uses the single-query strategy). Currently one failure to fix. 2010-10-15 16:21:42 +01:00
Jon Leighton
06c64eb606 Support preloading nested through associations (using the default multi-query strategy) 2010-10-15 15:46:19 +01:00
Jon Leighton
11508db1be Remove unnecessary requires from nested_has_many_through_associations_test.rb 2010-10-14 13:52:38 +01:00
Jon Leighton
002985fb66 Add test_has_one_through_has_one_through_with_belongs_to_source_reflection 2010-10-14 13:44:32 +01:00
Jon Leighton
25acd19da5 Add test_has_many_through_belongs_to_with_has_many_through_source_reflection (which already passes) 2010-10-14 13:16:47 +01:00
Jon Leighton
7963c30eba Add test_has_many_through_has_many_through_with_belongs_to_source_reflection (which already works) 2010-10-14 13:07:28 +01:00
Jon Leighton
bc821a5611 Added test_has_many_through_has_many_with_has_many_through_habtm_source_reflection and make it pass 2010-10-14 12:59:16 +01:00
Jon Leighton
22782e2cc1 Fix bug in previous refactoring 2010-10-14 12:31:35 +01:00
Jon Leighton
3fb493c2b0 Merge branch 'master' into nested_has_many_through
Conflicts:
	activerecord/lib/active_record/associations.rb
	activerecord/test/cases/associations/cascaded_eager_loading_test.rb
2010-10-14 10:25:43 +01:00
Piotr Sarnacki
f07cbec865 Do not treat information about skipped migrations as WARNINGs but as a NOTEs, also puts to stdin 2010-10-14 07:46:12 +02:00
Aaron Patterson
676a00163d clear any stale connections before messing with threaded tests 2010-10-13 16:58:03 -07:00
Carl Lerche
91ba75806f Update the ActiveRecord tests to not set unused options
This makes a test fail, but it is revealing a bug in Arel master.
2010-10-13 12:32:52 -07:00
Carl Lerche
0b6af35ef0 Update the PostgreSQL adapter documentation 2010-10-13 11:49:32 -07:00
Carl Lerche
941844cbe5 rb_thread_select should always be used in DB drivers when available. 2010-10-13 11:40:47 -07:00
Jon Leighton
212fdd8ba9 Add test_has_many_through_has_and_belongs_to_many_with_has_many_source_reflection and make it work 2010-10-13 18:36:51 +01:00
Jon Leighton
5d8bb06090 Refactoring ThroughAssociationScope#construct_through_joins 2010-10-13 17:55:41 +01:00
Jon Leighton
1ddbb216ea Delete unused methods in JoinAssociation 2010-10-13 08:24:19 -07:00
Jon Leighton
19304a9758 Renaming and formatting changes in JoinDependency 2010-10-13 08:24:19 -07:00
Jon Leighton
7dcb633427 Refactor JoinDependency and friends so that a JoinAssociation can produce an arbitrary number of joins, which will be needed in order to support nested through associations. 2010-10-13 08:24:19 -07:00
Jon Leighton
076b75bf98 Add some tests for functionality in JoinAssociation which already exists but was previously untested 2010-10-13 08:24:19 -07:00
Jon Leighton
781ad0f8fe First bit of support for habtm in through assocs - test_has_many_through_has_many_with_has_and_belongs_to_many_source_reflection now passes 2010-10-13 01:29:09 +01:00
Jon Leighton
199db8c8c0 Hook ThroughAssociationScope up to use the AliasTracker class 2010-10-13 00:05:04 +01:00
Jon Leighton
3f2e25805d Some small tweaks on the last commit 2010-10-12 23:42:30 +01:00
Aaron Patterson
603406dc53 stop using deprecated arel API 2010-10-12 14:33:16 -07:00
Aaron Patterson
25a2909355 dry up column type testing 2010-10-12 13:13:19 -07:00
Aaron Patterson
4b2e16ed24 all columns respond to string_to_binary, so no need to check respond_to? 2010-10-12 13:10:52 -07:00
Aaron Patterson
5b5ae01f29 drying up true and false cases 2010-10-12 11:59:20 -07:00
Aaron Patterson
01893f43f6 reducing comparisons in when statements 2010-10-12 11:55:52 -07:00
Jon Leighton
e8874318b7 Extract aliasing code from JoinDependency and JoinAssociation into a separate AliasTracker class. This can then be used by ThroughAssociationScope as well. 2010-10-12 19:49:32 +01:00
Aaron Patterson
9852a72417 removing intermediate variables 2010-10-12 11:48:41 -07:00
Aaron Patterson
c882154cd1 reduce the number of times we test for the column variable 2010-10-12 11:45:59 -07:00
Aaron Patterson
0ca9c836c0 test quoting a string with an unknown column type 2010-10-12 11:43:50 -07:00
Aaron Patterson
31b132aa9b refactoring date / time / datetime when statement 2010-10-12 11:41:23 -07:00
Aaron Patterson
ef11ce2af8 fixing case / when indentation 2010-10-12 11:38:40 -07:00
Aaron Patterson
98cb754cd7 test quoting multibyte chars object 2010-10-12 11:38:07 -07:00
Aaron Patterson
2681dd81b4 test quoting strings with binary columns 2010-10-12 11:34:21 -07:00
Aaron Patterson
4804cb485c test quoting a string with a float column 2010-10-12 11:30:34 -07:00
Aaron Patterson
50ad7f6561 testing quoting a string for an int column 2010-10-12 11:29:28 -07:00
Aaron Patterson
07b0b5b330 testing crazy object quoting 2010-10-12 11:25:20 -07:00
Aaron Patterson
1ba3489b75 test that dates / times / datetimes call quoted_date 2010-10-12 11:21:35 -07:00
Aaron Patterson
8b33f66891 test quoting of bigdecimals 2010-10-12 11:08:10 -07:00
Jon Leighton
c37a5e7acd Add a commented, failing test for using a habtm in a has many through association. I want to refactor how aliasing works first. 2010-10-12 18:16:31 +01:00
Jon Leighton
56064aa4b0 Add test_has_many_through_has_one_through_with_has_many_source_reflection 2010-10-12 17:32:52 +01:00
Jon Leighton
dc39aceb94 Adding test_has_many_through_has_one_with_has_many_through_source_reflection and modifying ThroughAssociationScope to make it work correctly. 2010-10-12 17:27:10 +01:00
Jon Leighton
6107386185 Rename some tests for consistency 2010-10-12 16:54:43 +01:00
Jon Leighton
6a016a5511 Add test_has_many_through_has_one_through 2010-10-12 16:53:22 +01:00