aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
Commit message (Collapse)AuthorAgeFilesLines
...
| * Provide a slightly more robust we_can_set_the_inverse_on_this? method for ↵Murray Steele2009-12-281-2/+7
| | | | | | | | | | | | | | | | polymorphic belongs_to associations. [#3520 state:resolved] Also add a new test for polymorphic belongs_to that test direct accessor assignment, not just .replace assignment. Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
| * Add inverse polymorphic association support. [#3520 state:resolved]George Ogata2009-12-281-10/+29
| | | | | | | | Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
| * Add more tests for the various ways we can assign objects to associations. ↵Murray Steele2009-12-281-2/+1
| | | | | | | | | | | | | | | | [#3513 state:resolved] Get rid of a duplicate set_inverse_instance call if you use new_record(true) (e.g. you want to replace the existing instance). Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
| * Set inverse for #replace on a has_one association. [#3513 state:resolved]George Ogata2009-12-281-0/+1
| | | | | | | | Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
* | Add Model.having and Relation#havingPratik Naik2009-12-291-1/+1
|/
* Add Model.readonly and association_collection#readonly finder methodPratik Naik2009-12-281-1/+1
|
* Add Model.lock and relation#lock now that arel has lockingPratik Naik2009-12-281-1/+1
|
* Add Model.from and association_collection#from finder methodsPratik Naik2009-12-281-1/+1
|
* Rewrite AssociationCollection#find using relationsPratik Naik2009-12-271-19/+13
|
* Add new finder methods to association collection.Pratik Naik2009-12-271-2/+17
|
* Rename Model.conditions and relation.conditions to .wherePratik Naik2009-12-262-2/+2
|
* Revert "Fix instance_eval calls to association proxies"Joshua Peek2009-12-121-2/+6
| | | | | | | | | | I think it may of broke the build. Lets see. This reverts commit 49e943c4f0ac3459bd53023167aaa08fc8e46733. Conflicts: activerecord/test/cases/associations/has_many_associations_test.rb
* Fix instance_eval calls to association proxiesMat Brown2009-12-021-6/+2
| | | | | | | | In the current stable, ActiveRecord::Associations::AssociationProxy#method_missing calls yield() if a block is given, causing the block to always be evaluated in its calling context. However, in the case of instance_eval, correct behavior requires that the block be passed directly to the @target, rather than being evaluated inside a different block. Incidentally, this also simplifies the code slightly. [#3412 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Revert "Revert "Assert primary key does not exist in habtm when the ↵Jeremy Kemper2009-11-231-13/+1
| | | | | | | | | | | | | association is defined, instead of doing that everytime a record is inserted."" This reverts commit 2b82708b0efb3a3458e8177beab58f0c585788ae. [#3128 state:resolved] Conflicts: activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
* Ruby 1.9.2: use recursive flattenJeremy Kemper2009-11-141-7/+1
|
* Ruby 1.9.2: fix flatten_deeper to preserve nilsJeremy Kemper2009-11-141-1/+1
|
* Revert "Split arel_table into method to get a relation and another to ↵Jeremy Kemper2009-11-132-3/+3
| | | | | | memoize the default relation." This reverts commit bd51790895fc75a3b4e19e8dd7aa6dc389d77068.
* Split arel_table into method to get a relation and another to memoize the ↵Jeremy Kemper2009-11-132-3/+3
| | | | default relation.
* Ruby 1.9.2: avoid #flattenJeremy Kemper2009-11-131-4/+16
|
* Arel::In -> Arel::Predicates::InJeremy Kemper2009-11-022-2/+2
|
* Merge commit 'rails/master'Emilio Tagua2009-10-131-1/+1
|\
| * Callbacks, DeprecatedCallbacks = NewCallbacks, CallbacksJoshua Peek2009-10-121-1/+1
| |
* | Merge commit 'rails/master'Emilio Tagua2009-10-021-0/+9
|\|
| * Make has_one with :conditions hash scope build or creation of the associated ↵Luciano G Panaro2009-09-281-0/+9
| | | | | | | | | | | | | | object with those conditions Signed-off-by: Michael Koziarski <michael@koziarski.com> [#3088 state:committed]
* | Merge commit 'rails/master'Emilio Tagua2009-09-141-2/+2
|\|
| * Fix habtm associations when using multiple databasessdsykes2009-09-121-2/+2
| | | | | | | | | | | | [#3128] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | Merge commit 'rails/master'Emilio Tagua2009-09-081-0/+16
|\| | | | | | | | | Conflicts: activerecord/lib/active_record/associations.rb
| * Revert "Assert primary key does not exist in habtm when the association is ↵Jeremy Kemper2009-09-021-0/+16
| | | | | | | | | | | | | | | | | | | | defined, instead of doing that everytime a record is inserted." Test failures on PostgreSQL. [#3128 state:open] This reverts commit da636809daca9c338200811d3590e446f57c8e81.
* | Merge commit 'rails/master'Emilio Tagua2009-09-011-16/+0
|\| | | | | | | | | Conflicts: activerecord/lib/active_record/associations.rb
| * Assert primary key does not exist in habtm when the association is defined, ↵José Valim2009-09-011-16/+0
| | | | | | | | | | | | | | | | instead of doing that everytime a record is inserted. [#3128 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | Remove whitespace.Emilio Tagua2009-08-191-2/+2
| |
* | Remove unused quoted_record_ids, now ARel does this using ARel::In.Emilio Tagua2009-08-181-9/+0
| |
* | has_many nullify associations keys using ARel.Emilio Tagua2009-08-181-9/+9
| |
* | habtm insertion with ARel integration.Emilio Tagua2009-08-181-8/+5
| |
* | habtm delete method integrated with ARel.Emilio Tagua2009-08-181-4/+5
| |
* | Merge commit 'rails/master'Emilio Tagua2009-08-101-19/+16
|\|
| * Remove unnecessary scoping for creating hm:t join recordPratik Naik2009-08-101-3/+4
| |
| * Remove unnecessary scoping and validation checks from hm:t#createPratik Naik2009-08-101-1/+1
| |
| * Unify hm:t#create and create! implementationPratik Naik2009-08-101-17/+13
| |
* | Merge commit 'rails/master'Emilio Tagua2009-08-106-6/+34
|\| | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/calculations.rb activerecord/lib/active_record/connection_adapters/mysql_adapter.rb activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
| * raises an exception on habtm join table inserts if join table contains a ↵Jaime Bellmyer2009-08-091-2/+14
| | | | | | | | | | | | | | | | primary key. Caches this check to save time on subsequent inserts. [#2086 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * raises exception (ActiveRecord::ConfigurationError with message) on habtm ↵Jaime Bellmyer2009-08-091-0/+4
| | | | | | | | | | | | association creation if join table contains a primary key Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * Fix that counter_cache breaks with has_many :dependent => :nullify.Gabe da Silveira2009-08-091-0/+1
| | | | | | | | | | | | [#1196 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * has_many :through create should not raise validation errorsrailsbob2009-08-091-1/+5
| | | | | | | | | | | | [#2934 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * Allow ho:through#build when the owner is a new record [#1749 state:resolved]Tristan Dunn2009-08-101-3/+9
| | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * Enable has_many :through for going through a has_one association on the join ↵Gabe da Silveira2009-08-101-1/+1
| | | | | | | | | | | | model [#2719 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * Added back support for destroying an association's object by id. [#2306 ↵Joshua Nichols2009-08-091-0/+1
| | | | | | | | | | | | status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
| * Ensure hm:t#find does not assign nil to :include [#1845 state:resolved]railsbob2009-08-091-1/+1
| | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | Merge commit 'rails/master'Emilio Tagua2009-08-101-0/+4
|\| | | | | | | | | Conflicts: activerecord/lib/active_record/migration.rb
| * Ensure hm:t#create/create! throws ActiveRecord::RecordNotSaved when the ↵Pratik Naik2009-08-081-0/+4
| | | | | | | | owner is new