aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
Commit message (Collapse)AuthorAgeFilesLines
* More work on removing plain SQL from associations and use ARel instead.Emilio Tagua2009-08-071-4/+4
|
* Don't use local vars before testing its conditional.Emilio Tagua2009-08-031-2/+0
|
* Merge commit 'rails/master'Emilio Tagua2009-07-161-0/+98
|\
| * Add primary_key option to belongs_to associationSzymon Nowak2009-07-151-0/+98
| | | | | | | | | | | | [#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | Merge commit 'rails/master'Emilio Tagua2009-07-141-2/+6
|\|
| * Optimize <association>_ids for hm:t with belongs_to sourcePratik Naik2009-07-131-2/+6
| |
* | Merge commit 'rails/master'Emilio Tagua2009-06-302-0/+12
|\|
| * Revert "Revert "Generate proper :counter_sql from :finder_sql when there is ↵Pratik Naik2009-07-012-0/+12
| | | | | | | | | | | | | | | | | | a newline character immediately following 'SELECT' [#2118 state:resolved]"" This reverts commit 80f1f863cd0f9cba89079511282de5710a2e1832. The feature doesn't work on Postgres, so don't test it on Postgres. Also, Postgres compatibility is irrelevant to the ticket/patch in question.
* | Merge commit 'rails/master'Emilio Tagua2009-06-231-0/+6
|\|
| * Revert "Generate proper :counter_sql from :finder_sql when there is a ↵Yehuda Katz + Carl Lerche2009-06-222-10/+0
| | | | | | | | | | | | | | | | newline character immediately following 'SELECT' [#2118 state:resolved]" This reverts commit 4851ca9e13a4317342df02ae25b1929340523f7a. The tests do not pass for postgresql.
| * Generate proper :counter_sql from :finder_sql when there is a newline ↵Patrick Joyce2009-06-212-0/+10
| | | | | | | | | | | | character immediately following 'SELECT' [#2118 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * Ensure hm:t#create respects source associations hash conditions [#2090 ↵mattbauer2009-06-211-0/+6
| | | | | | | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | Merge commit 'rails/master'Emilio Tagua2009-06-022-3/+3
|\| | | | | | | | | | | Conflicts: activerecord/lib/active_record.rb
| * Merge branch 'master' into active_modelJoshua Peek2009-05-297-38/+420
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activemodel/lib/active_model/core.rb activemodel/test/cases/state_machine/event_test.rb activemodel/test/cases/state_machine/state_transition_test.rb activerecord/lib/active_record/validations.rb activerecord/test/cases/validations/i18n_validation_test.rb activeresource/lib/active_resource.rb activeresource/test/abstract_unit.rb
| | * Break up DependencyModule's dual function of providing a "depend_on" DSL and ↵Joshua Peek2009-05-281-1/+1
| | | | | | | | | | | | "included" block DSL into separate modules. But, unify both approaches under AS::Concern.
| * | Merge branch 'master' into active_modelPratik Naik2009-04-222-0/+11
| |\ \ | | | | | | | | | | | | | | | | Conflicts: activeresource/lib/active_resource/validations.rb
| * | | Deprecate Error#on(attribute) in favour of Errors#[attribute]Pratik Naik2009-03-201-2/+2
| | | |
* | | | Merge commit 'rails/master'Emilio Tagua2009-05-261-1/+1
|\ \ \ \ | | |_|/ | |/| |
| * | | Fix eager association test related to different ordering on sqliteChad Woolley2009-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | [#2686 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | | | Merge commit 'rails/master'Emilio Tagua2009-05-191-1/+1
|\| | |
| * | | Add missing models and fixtures [#2673 state:resolved]Emilio Tagua2009-05-191-23/+23
| | | | | | | | | | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | | | Merge commit 'rails/master'Emilio Tagua2009-05-181-2/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record.rb Updated: Arel submodule
| * | | Ensure HasManyThroughAssociation#destroy delete orphan records [#2251 ↵Luca Guidi2009-05-181-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | | | Merge commit 'rails/master'Emilio Tagua2009-05-185-1/+53
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/base.rb activerecord/lib/active_record/migration.rb activerecord/test/cases/helper.rb
| * | | Fixed limited eager loading associations with numbers in the name [#2668 ↵Benjamin Floering2009-05-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * | | Implement #many? for NamedScope and AssociationCollection using #size [#1500 ↵Chris Kampmeier2009-05-171-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * | | has_one :through should not create a new association when assigned nil [#698 ↵Daniel Guettler2009-05-171-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * | | Cherry-pick core extensionsJeremy Kemper2009-05-132-0/+2
| | | |
* | | | Merge commit 'rails/master'Emilio Tagua2009-05-124-15/+80
|\| | |
| * | | Use DependencyModule for included hooks in ActiveRecordBryan Helmkamp2009-05-111-7/+6
| | | |
| * | | Revert "Fixed bug with polymorphic has_one :as pointing to an STI record"Jeremy Kemper2009-05-111-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | [#2594 state:open] This reverts commit 99c103be1165da9c8299bc0977188ecf167e06a5.
| * | | Fixed eager load error on find with include => [:table_name] and hash ↵Anthony Crumley2009-05-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | conditions like {:table_name => {:column => 'value'}} Signed-off-by: Michael Koziarski <michael@koziarski.com>
| * | | honour :inverse_of for joins based includeFrederick Cheung2009-05-101-0/+28
| | | | | | | | | | | | | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
| * | | honour inverse_of when preloading associationsFrederick Cheung2009-05-101-0/+33
| | | | | | | | | | | | | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* | | | Merge commit 'rails/master'Emilio Tagua2009-05-051-0/+252
|\| | |
| * | | Providing support for :inverse_of as an option to associations.Murray Steele2009-05-041-0/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now add an :inverse_of option to has_one, has_many and belongs_to associations. This is best described with an example: class Man < ActiveRecord::Base has_one :face, :inverse_of => :man end class Face < ActiveRecord::Base belongs_to :man, :inverse_of => :face end m = Man.first f = m.face Without :inverse_of m and f.man would be different instances of the same object (f.man being pulled from the database again). With these new :inverse_of options m and f.man are the same in memory instance. Currently :inverse_of supports has_one and has_many (but not the :through variants) associations. It also supplies inverse support for belongs_to associations where the inverse is a has_one and it's not a polymorphic. Signed-off-by: Murray Steele <muz@h-lame.com> Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | | | Merge commit 'rails/master'Emilio Tagua2009-05-021-1/+8
|\| | |
| * | | Fixed bug with polymorphic has_one :as pointing to an STI recordRuy Asan2009-05-011-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | [#2594 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | | | Calculations now use Arel to construct the query.Emilio Tagua2009-04-291-22/+22
| | | | | | | | | | | | | | | | Implemented other methods in AR::Base with Arel support.
* | | | construct_finder_sql now use ArelEmilio Tagua2009-04-241-1/+1
|/ / /
* | / Fix models load order to be able to run unit tests.Emilio Tagua2009-04-231-5/+5
| |/ |/| | | | | | | | | [#2550 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | Ensure :dependent => :delete_all works for association with hash conditionsPratik Naik2009-04-201-0/+6
| |
* | Ensure JoinAssociation uses aliased table name when multiple associations ↵Pratik Naik2009-04-201-0/+5
|/ | | | have hash conditions on the same table
* Ensure AutosaveAssociation runs remove callbacks [#2146 state:resolved]Luca Guidi2009-03-123-0/+69
| | | | | Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure NoMethodError isn't raised when some of the nested eager loaded ↵Murray Steele2009-03-121-0/+29
| | | | | | associations are empty [#1696 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed autosave checks on objects with hm:t in :include [#2213 state:resolved]Will Bryant2009-03-123-0/+48
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add tests for AssociationCollection#find_each and ↵Pratik Naik2009-03-111-0/+39
| | | | AssociationCollection#find_in_batches
* Ensure has_many :through works with changed primary keys [#736 state:resolved]Jim Remsik and Tim Pope2009-03-091-1/+8
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix find_by_last when order is given [#2127 state:committed]Jan De Poorter2009-03-091-0/+4
| | | | Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.Jeremy Kemper2009-03-086-27/+27
| | | | [#1617 state:resolved]