aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_through_association.rb
Commit message (Collapse)AuthorAgeFilesLines
...
| * Remove unused varSantiago Pastorino2010-11-141-1/+1
| |
| * Fix bug where size of through association is not correct after adding a ↵Jason Cheow2010-11-141-1/+0
| | | | | | | | | | | | | | | | has_many association (occurs only before main object has been reloaded). [#5968 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
| * use persisted? instead of new_record? wherever possibleDavid Chelimsky2010-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | - persisted? is the API defined in ActiveModel - makes it easier for extension libraries to conform to ActiveModel APIs without concern for whether the extended object is specifically ActiveRecord [#5927 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
| * Refactoring: replace the mix of variables like @finder_sql, @counter_sql, ↵Jon Leighton2010-10-301-15/+1
| | | | | | | | 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.
* | Fix naughty trailing whitespaceJon Leighton2010-10-311-2/+2
| |
* | Remove obsolete require to active_record/associations/nested_has_many_throughJon Leighton2010-10-191-1/+0
| |
* | Refactoring: replace the mix of variables like @finder_sql, @counter_sql, ↵Jon Leighton2010-10-171-15/+1
| | | | | | | | 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.
* | Make sure nested through associations are read onlyJon Leighton2010-10-151-0/+10
| |
* | Integrate nested support into ThroughAssociationScope, using my concept of ↵Jon Leighton2010-10-021-1/+0
| | | | | | | | generating a 'chain' of reflections to be joined. It seems to work at the moment, all existing tests are passing. There may be further complications as we add more test cases for nested associations, though.
* | Started implementing nested :through associations by using the existing ↵Jon Leighton2010-10-011-1/+1
| | | | | | | | structure of ThroughAssociationScope rather than layering a module over the top
* | Initial nested_has_many_through support [#1152]Bodaniel Jeanes2010-09-261-0/+2
|/
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-3/+3
| | | | 's/[ \t]*$//' -i {} \;)
* ensuring that description does not exceed 100 columnsNeeraj Singh2010-08-021-3/+4
|
* Adds title to activerecord/lib/active_record/associations/*Rizwan Reza2010-06-161-0/+1
|
* adds missing requires for Object#blank? and Object#present?Xavier Noria2010-03-281-0/+1
|
* save(false) is gone, use save(:validate => false) instead.José Valim2010-01-171-1/+1
|
* Make scopes use relations under the hoodPratik Naik2010-01-161-2/+0
|
* 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-101-2/+6
|\| | | | | | | | | | | | | 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
| * has_many :through create should not raise validation errorsrailsbob2009-08-091-1/+5
| | | | | | | | | | | | [#2934 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * 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
* | Merge commit 'rails/master'Emilio Tagua2009-06-301-9/+1
|\|
| * Revert "Revert "Generate proper :counter_sql from :finder_sql when there is ↵Pratik Naik2009-07-011-9/+1
| | | | | | | | | | | | | | | | | | 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.
| * Revert "Generate proper :counter_sql from :finder_sql when there is a ↵Yehuda Katz + Carl Lerche2009-06-221-1/+9
| | | | | | | | | | | | | | | | 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-211-9/+1
| | | | | | | | | | | | character immediately following 'SELECT' [#2118 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | Leave the quoting part to ARelEmilio Tagua2009-06-121-150/+5
|\|
| * HasOneThroughAssociation still shouldn't derive from HasManyThroughAssociation.Adam Milligan2009-06-121-150/+5
| | | | | | | | | | | | [#1642 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | Use ARel in SQL generation through associationsEmilio Tagua2009-06-101-4/+4
|/
* Ensure HasManyThroughAssociation#destroy delete orphan records [#2251 ↵Luca Guidi2009-05-181-0/+7
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Providing support for :inverse_of as an option to associations.Murray Steele2009-05-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* Fixed that autosave should validate associations even if master is invalid ↵David Heinemeier Hansson2009-02-271-2/+2
| | | | [#1930 status:committed]
* 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 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>
* Make AssociationCollection start transactions in the correct database.Hongli Lai (Phusion)2008-09-231-2/+2
| | | | | | | | | | 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]
* Add special AssociationReflection methods for creating association objects, ↵Hongli Lai (Phusion)2008-09-091-4/+5
| | | | | | | | 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>
* Refactored AssociationCollection#count for uniformity and Ruby 1.8.7 support.Ernie Miller2008-08-281-10/+0
| | | | | | [#831 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Use type_condition method for hmt STI conditionTarmo Tänav2008-08-151-1/+1
|
* Extract owner_quoted_id so it can be overridden. [#292 state:committed]Andre Arko2008-06-251-3/+3
|
* Add ActiveRecord::Base.sti_name that checks ↵rick2008-05-311-1/+1
| | | | ActiveRecord::Base#store_full_sti_class? and returns either the full or demodulized name. [rick] [#114 state:resolved]
* Merge docrails.Pratik Naik2008-05-251-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* best solution?Steven Soroka2008-05-011-2/+2
| | | | Signed-off-by: Steven Soroka <ssoroka78@gmail.com>
* Remove duplicate code from associations. [Pratik]Pratik Naik2008-04-061-60/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9231 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor HasManyThroughAssociation to inherit from HasManyAssociation. ↵Pratik Naik2008-04-061-61/+32
| | | | | | Association callbacks and <association>_ids= now work with hm:t. Closes #11516 [rubyruy] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de