aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
Commit message (Collapse)AuthorAgeFilesLines
* Ensure JoinAssociation uses aliased table name when multiple associations ↵Pratik Naik2009-04-201-2/+2
| | | | have hash conditions on the same table
* Merge docrailsPratik Naik2009-03-161-5/+9
|
* Ensure AutosaveAssociation runs remove callbacks [#2146 state:resolved]Luca Guidi2009-03-121-19/+32
| | | | | Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add tests for AssociationCollection#find_each and ↵Pratik Naik2009-03-111-1/+1
| | | | AssociationCollection#find_in_batches
* Ensure has_many :through works with changed primary keys [#736 state:resolved]Jim Remsik and Tim Pope2009-03-091-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix RDoc grammar and ensure hm:t tests can run in isolation. [#1644 ↵Adam Milligan2009-03-071-2/+2
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure replacing has_one associations respects the supplied :dependent ↵Dimitri Krassovski2009-03-061-2/+11
| | | | | | option. [#1305 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed that autosave should validate associations even if master is invalid ↵David Heinemeier Hansson2009-02-273-6/+6
| | | | [#1930 status:committed]
* Cache columns for has_and_belongs_to_many associationslukeludwig2009-01-171-3/+9
| | | | | This avoids repeatedly calling SHOW COLUMNS when the association is queried [#1738 state:committed]
* Fix HasManyAssociation#create ignoring the :primary_key option [#1633 ↵Roman Shterenzon2008-12-271-1/+4
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Fix has many through not quoting table names [#1163 state:resolved]Karthik Krishnan2008-12-201-3/+3
| | | | Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Fix preloading of has_one :through associations on belongs_to [#1507 ↵Matt Jones2008-12-181-1/+5
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Revert "Fix: counter_cache should decrement on deleting associated records."Jeremy Kemper2008-12-101-3/+0
| | | | | | [#1196 state:open] This reverts commit 05f2183747c8e75c9e8bbaadb9573b4bdf41ecfc.
* Fix: counter_cache should decrement on deleting associated records.Emilio Tagua2008-12-101-0/+3
| | | | | | [#1195 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Make NoMethodError message more descriptive when an undefined message has ↵Mike Ferrier2008-12-041-1/+4
| | | | | | been sent to an association [#1515 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Add :having option to find, to use in combination with grouped finds. Also ↵miloops2008-12-011-0/+1
| | | | | | | added to has_many and has_and_belongs_to_many associations. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1028 state:committed]
* fix assignment to has_one :through associations.Matt Jones2008-11-151-4/+3
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Merge with docrails. Also add a rake task to generate guides in your rails ↵Pratik Naik2008-10-212-1/+8
| | | | | | | | application : rake doc:guides The rake task will generate guides inside doc/guides directory of your application. Open index.html to browse.
* Ensure association proxy responds to private class methods defined in ↵Pratik Naik2008-10-161-2/+2
| | | | associated class. [#1083]
* Allow class methods to be sent (via #send) to association proxy (fix for bug ↵Ian White2008-10-161-0/+4
| | | | | | introduced by 691aa20) [#1083] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure methods called on association proxies respect access control. [#1083 ↵Pratik Naik2008-10-132-1/+12
| | | | state:resolved] [Adam Milligan, Pratik]
* Fix has_many :through when the source is a belongs_to association. [#323 ↵Zach Dennis2008-10-041-0/+11
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Try reloading model on class mismatch [#229 state:resolved]Lawrence Pit2008-10-041-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Make AssociationCollection start transactions in the correct database.Hongli Lai (Phusion)2008-09-232-6/+21
| | | | | | | | | | AssociationCollection now starts transactions by calling AssociationCollection#transaction instead of @owner.transaction or @reflection.klass.transaction. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1081 state:committed]
* Association#first and last should not load the association if not needed. ↵Jan De Poorter2008-09-221-3/+4
| | | | | | [#1091 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Update the documentation to reflect the change handling :group earlierMichael Koziarski2008-09-161-1/+4
|
* When counting grouped records the target should be loaded to return a valid ↵miloops2008-09-151-0/+2
| | | | | | | | | groups count result. Without this change count_records will group for the count in the query and return erroneous results. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#937 state:committed]
* Revert "Add :accessible option to Associations for allowing mass assignments ↵Pratik Naik2008-09-101-6/+0
| | | | | | | | | | | | using hash. [#474 state:resolved]" This reverts commit e0750d6a5c7f621e4ca12205137c0b135cab444a. Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/association_collection.rb
* Add special AssociationReflection methods for creating association objects, ↵Hongli Lai (Phusion)2008-09-094-14/+25
| | | | | | | | and modify the code base to use those methods instead of creating association objects directly. This allows plugins to hook into association object creation behavior. [#986 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Merge docrailsPratik Naik2008-09-033-15/+92
|
* Refactored AssociationCollection#count for uniformity and Ruby 1.8.7 support.Ernie Miller2008-08-284-36/+39
| | | | | | [#831 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Implement count limit/offset support for has_many associationsTarmo Tänav2008-08-271-1/+10
| | | | | | [#348 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* respond_to? passes along splat args to avoid introducing the second arg if ↵Jeremy Kemper2008-08-271-2/+2
| | | | it was omitted
* Fix two has_one :through errorspivotal2008-08-271-0/+4
| | | | | | | | * Set the association target on assignment; * Reset target to nil on reset, rather than empty array. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#895 state:committed]
* Ruby 1.9 compat: Hash is now flattenable, so explicitly exclude itJeremy Kemper2008-08-231-1/+1
|
* Fix has_many#count_records. [#865 state:resolved]Xavier Noria2008-08-211-2/+5
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix that has_one natural assignment to already associated record. [#854 ↵Jakub Kuźma2008-08-211-2/+2
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Updated has_and_belongs_to_many association to fix :finder_sql ↵Nathan Witmer2008-08-162-7/+1
| | | | | | interpolation. [#848 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Use type_condition method for hmt STI conditionTarmo Tänav2008-08-151-1/+1
|
* Fixed AssociationCollection#<< resulting in unexpected values in @target ↵Ernie Miller2008-08-081-1/+1
| | | | | | when :uniq => true Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fix file permissionsTarmo Tänav2008-07-313-0/+0
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Add :accessible option to Associations for allowing mass assignments using ↵David Dollar2008-07-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | hash. [#474 state:resolved] Allows nested Hashes (i.e. from nested forms) to hydrate the appropriate ActiveRecord models. class Post < ActiveRecord::Base belongs_to :author, :accessible => true has_many :comments, :accessible => true end post = Post.create({ :title => 'Accessible Attributes', :author => { :name => 'David Dollar' }, :comments => [ { :body => 'First Post!' }, { :body => 'Nested Hashes are great!' } ] }) post.comments << { :body => 'Another Comment' } Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add block syntax to HasManyAssociation#build. [#502 state:resolve]Jason Dew2008-07-141-3/+6
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Remove some Symbol#to_proc usage in runtime code. [#484 state:resolved]Cheah Chu Yeow2008-07-092-3/+3
|
* Add support for :primary_key option to has_one as well as has_many so that a ↵Brad Greenlee2008-07-061-1/+10
| | | | | | key other than the default primary key can be used for the association Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Add has_many :primary_key option to allow setting the primary key on a has ↵Andre Arko2008-07-061-0/+8
| | | | | | many association Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Ensure AssociationCollection#size considers all unsaved record. [#305 ↵Pratik Naik2008-07-021-1/+1
| | | | | | state:resolved] [sds] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Cache sanitized conditions in reflection object for associationsPratik Naik2008-06-271-1/+1
|
* Extract owner_quoted_id so it can be overridden. [#292 state:committed]Andre Arko2008-06-255-11/+15
|
* fix eager loading with dynamic findersBrandon Keepers2008-06-092-1/+2
|