aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
Commit message (Collapse)AuthorAgeFilesLines
* Respect the :primary_key option on the through_reflection of (non-nested) ↵Jon Leighton2010-10-193-8/+8
| | | | through associations
* Properly support conditions on any of the reflections involved in a nested ↵Jon Leighton2010-10-191-67/+60
| | | | through association
* Refactoring: replace the mix of variables like @finder_sql, @counter_sql, ↵Jon Leighton2010-10-1710-152/+136
| | | | 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-153-9/+30
|
* Added ↵Jon Leighton2010-10-141-2/+6
| | | | test_has_many_through_has_many_with_has_many_through_habtm_source_reflection and make it pass
* Fix bug in previous refactoringJon Leighton2010-10-141-6/+6
|
* Add ↵Jon Leighton2010-10-131-3/+28
| | | | test_has_many_through_has_and_belongs_to_many_with_has_many_source_reflection and make it work
* Refactoring ThroughAssociationScope#construct_through_joinsJon Leighton2010-10-131-54/+62
|
* First bit of support for habtm in through assocs - ↵Jon Leighton2010-10-131-13/+32
| | | | test_has_many_through_has_many_with_has_and_belongs_to_many_source_reflection now passes
* Hook ThroughAssociationScope up to use the AliasTracker classJon Leighton2010-10-131-9/+30
|
* Some small tweaks on the last commitJon Leighton2010-10-121-2/+7
|
* Extract aliasing code from JoinDependency and JoinAssociation into a ↵Jon Leighton2010-10-121-0/+68
| | | | separate AliasTracker class. This can then be used by ThroughAssociationScope as well.
* Add a commented, failing test for using a habtm in a has many through ↵Jon Leighton2010-10-121-46/+50
| | | | association. I want to refactor how aliasing works first.
* Adding test_has_many_through_has_one_with_has_many_through_source_reflection ↵Jon Leighton2010-10-121-1/+1
| | | | and modifying ThroughAssociationScope to make it work correctly.
* Support has_one through assocs as the source associationJon Leighton2010-10-121-10/+21
|
* Add support for nested through associations in JoinAssociation. Hence ↵Jon Leighton2010-10-091-0/+4
| | | | Foo.joins(:bar) will work for through associations. There is some duplicated code now, which will be refactored.
* Merge branch 'master' into nested_has_many_throughJon Leighton2010-10-061-0/+12
|\
| * Refactor AssociationCollection#include? with objects in memoryCarlos Antonio da Silva2010-10-021-4/+3
| | | | | | | | Signed-off-by: José Valim <jose.valim@gmail.com>
| * AssociationCollection#include? working properly for objects added with build ↵Marcelo Giorgi2010-09-301-0/+13
| | | | | | | | method [#3472 state:resolved]
* | Add support for table aliasing, with a test that needs aliasing in order to ↵Jon Leighton2010-10-021-13/+37
| | | | | | | | work correctly. This test incidentally provides a more complicated test case (4 inner joins, 2 using polymorphism).
* | Integrate nested support into ThroughAssociationScope, using my concept of ↵Jon Leighton2010-10-023-37/+55
| | | | | | | | 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-012-19/+32
| | | | | | | | structure of ThroughAssociationScope rather than layering a module over the top
* | Merge branch 'master' into nested_has_many_through_2Jon Leighton2010-09-301-1/+1
|\|
| * no need of nil checkNeeraj Singh2010-09-291-1/+1
| |
* | Initial nested_has_many_through support [#1152]Bodaniel Jeanes2010-09-262-0/+158
|/
* Refactor association_collection uniq method.Emilio Tagua2010-09-221-4/+3
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Perf: refactor method.Emilio Tagua2010-09-221-11/+8
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* do not pass nil values to arelAaron Patterson2010-09-211-1/+1
|
* Use scoped here to get the scoped whereSantiago Pastorino2010-09-051-5/+3
|
* mark SQL literals as SQL literalsAaron Patterson2010-08-251-1/+1
|
* marking sql literals as sql literalsAaron Patterson2010-08-231-1/+1
|
* While creating a new record using has_many create method default scope of ↵Neeraj Singh2010-08-191-1/+6
| | | | | | | | | | | child should be respected. author.posts.create should take into account default_scope defined on post. [#3939: state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-143-10/+10
| | | | 's/[ \t]*$//' -i {} \;)
* Removing most of the symbol to proc usage in Active RecordPrem Sichanugrist2010-08-131-1/+1
| | | | This will hopefully make Active Record run a bit more faster.
* removing references to arel constantsAaron Patterson2010-08-131-1/+1
|
* avoiding symbol to proc againAaron Patterson2010-08-131-1/+1
|
* do not use arel constants directlyAaron Patterson2010-08-131-1/+1
|
* symbol to proc is slow, we should avoid itAaron Patterson2010-08-131-1/+1
|
* dry up the hash dup and avoid sending nil valuesAaron Patterson2010-08-112-11/+15
|
* standarizes the use of the article "an" for "SQL" and "SQLite"Xavier Noria2010-08-051-1/+1
|
* ensuring that description does not exceed 100 columnsNeeraj Singh2010-08-022-6/+8
|
* Don't increment and then decrement the same counter when re-assigning a ↵Tarmo Tänav2010-07-291-1/+1
| | | | | | | | belongs_to association [#2786 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* fixed joining of attributes when using find_or_create_by with multiple ↵Jon Buda2010-07-281-1/+1
| | | | | | attributes through an association Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* No need to check for :uniqNeeraj Singh2010-07-261-6/+3
| | | | | | [#5170 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Make use of tap to return a previously used varSantiago Pastorino2010-07-211-4/+4
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Ensure all join table attributes will be in the same timestamp.José Valim2010-07-211-11/+21
|
* Timestamp columns of HABTM join table should record timestampsNeeraj Singh2010-07-211-1/+5
| | | | [#5161 state:resolved]
* association load target shouldn't replace recordsSzetobo2010-07-211-3/+4
| | | | | | | | from db if it is already loaded by nested attributes assignment [#5053 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* In nested_attributes when association is not loaded and associationSubba Rao Pasupuleti2010-07-211-1/+8
| | | | | | | | record is saved and then in memory record attributes should be saved [#5053 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* id is a public methodSantiago Pastorino2010-07-211-2/+2
|