Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Use bind values for joined tables in where statements | Sean Griffin | 2014-11-01 | 1 | -0/+1 |
| | | | | | | | | | | | | | | | In practical terms, this allows serialized columns and tz aware columns to be used in wheres that go through joins, where they previously would not behave correctly. Internally, this removes 1/3 of the cases where we rely on Arel to perform type casting for us. There were two non-obvious changes required for this. `update_all` on relation was merging its bind values with arel's in the wrong order. Additionally, through associations were assuming there would be no bind parameters in the preloader (presumably because the where would always be part of a join) [Melanie Gilman & Sean Griffin] | ||||
* | Spelling errors | jbsmith86 | 2014-08-14 | 1 | -1/+1 |
| | |||||
* | reset `@arel` when modifying a Relation in place. | Yves Senn | 2014-04-24 | 1 | -1/+1 |
| | | | | /cc @tenderlove | ||||
* | Replace map.flatten with flat_map in activerecord | Erik Michaels-Ober | 2014-03-03 | 1 | -1/+1 |
| | |||||
* | read the association instead of sending | Aaron Patterson | 2013-10-14 | 1 | -1/+3 |
| | |||||
* | simplify populating the ordering hash | Aaron Patterson | 2013-10-14 | 1 | -10/+5 |
| | |||||
* | the preloader for the RHS has all the preloaded records, so ask it | Aaron Patterson | 2013-10-14 | 1 | -3/+3 |
| | |||||
* | only calculate offset index once. #12537 | Aaron Patterson | 2013-10-14 | 1 | -6/+10 |
| | |||||
* | Drop unused iterator var | Vipul A M | 2013-10-13 | 1 | -1/+1 |
| | |||||
* | remove initialize method | Aaron Patterson | 2013-09-25 | 1 | -4/+0 |
| | |||||
* | extract association resetting to a method | Aaron Patterson | 2013-09-25 | 1 | -9/+16 |
| | |||||
* | always populate the preloaded records instance variable so we can remove | Aaron Patterson | 2013-09-25 | 1 | -7/+4 |
| | | | | the @associated_records_by_owner ivar | ||||
* | keep preloaded records in a list rather than extract from a hash | Aaron Patterson | 2013-09-25 | 1 | -2/+8 |
| | |||||
* | all records have a preloaded, so eliminate that conditional | Aaron Patterson | 2013-09-24 | 1 | -11/+7 |
| | |||||
* | eliminate the `loaded?` conditional | Aaron Patterson | 2013-09-24 | 1 | -3/+1 |
| | |||||
* | push preloaded test up to the factory method so we can eliminate | Aaron Patterson | 2013-09-24 | 1 | -3/+3 |
| | | | | conditionals from the individual preloaded classes | ||||
* | we can't sort by lhs since the middle records have difference classes | Aaron Patterson | 2013-09-23 | 1 | -19/+19 |
| | | | | and possibly different rules for finding those objects | ||||
* | pass the preloader down so we only have to construct one | Aaron Patterson | 2013-09-23 | 1 | -8/+6 |
| | |||||
* | remove state from the preloader | Aaron Patterson | 2013-09-23 | 1 | -10/+9 |
| | |||||
* | only do the should_reset test once | Aaron Patterson | 2013-09-23 | 1 | -6/+6 |
| | |||||
* | fix variable names and speed up relation ordering | Aaron Patterson | 2013-09-23 | 1 | -7/+11 |
| | |||||
* | hm:t preloading will respect order set on the RHS association | Aaron Patterson | 2013-09-23 | 1 | -2/+25 |
| | |||||
* | combine methods so we can reuse preloaders | Aaron Patterson | 2013-09-20 | 1 | -19/+18 |
| | |||||
* | return a list rather than hash | Aaron Patterson | 2013-09-20 | 1 | -7/+13 |
| | |||||
* | split up construction and mutation | Aaron Patterson | 2013-09-20 | 1 | -1/+4 |
| | |||||
* | remove intermediate variable | Aaron Patterson | 2013-08-27 | 1 | -3/+1 |
| | |||||
* | cache association reset calculation | Aaron Patterson | 2013-08-27 | 1 | -4/+4 |
| | |||||
* | query the association rather than send the method for the association name | Aaron Patterson | 2013-08-27 | 1 | -5/+6 |
| | |||||
* | don't shadow `through_scope` method name with local var. | Yves Senn | 2013-06-30 | 1 | -7/+7 |
| | |||||
* | don't apply invalid ordering when preloading hmt associations. | Yves Senn | 2013-02-24 | 1 | -2/+2 |
| | | | | | | | | | | | | | | | closes #8663. When preloading a hmt association there two possible scenarios: 1.) preload with 2 queries: first hm association, then hmt with id IN () 2.) preload with join: hmt association is loaded with a join on the hm association The bug was happening in scenario 1.) with a normal order clause on the hmt association. The ordering was also applied when loading the hm association, which resulted in the error. This patch only applies the ordering the the hm-relation if we are performing a join (2). Otherwise the order will only appear in the second query (1). | ||||
* | don't cache invalid subsets when preloading hmt associations. | Yves Senn | 2013-02-14 | 1 | -1/+2 |
| | | | | closes #8423. | ||||
* | Represent association scope options as AR::Relations insternally. | Jon Leighton | 2012-07-13 | 1 | -16/+11 |
| | |||||
* | Revert "Deprecate implicit eager loading. Closes #950." | Jon Leighton | 2012-01-16 | 1 | -1/+0 |
| | | | | This reverts commit c99d507fccca2e9e4d12e49b4387e007c5481ae9. | ||||
* | Deprecate implicit eager loading. Closes #950. | Jon Leighton | 2011-12-29 | 1 | -0/+1 |
| | |||||
* | Stop identity-mapping the through records in the preloader since I fixed the ↵ | Jon Leighton | 2011-03-04 | 1 | -5/+0 |
| | | | | underlying problem in the habtm preloader. | ||||
* | Merge branch 'master' into nested_has_many_through | Jon Leighton | 2011-03-04 | 1 | -0/+5 |
|\ | |||||
* | | Merge branch 'master' into nested_has_many_through | Jon Leighton | 2011-03-04 | 1 | -2/+3 |
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/associations/has_one_through_association.rb activerecord/lib/active_record/associations/through_association_scope.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/associations/has_many_through_associations_test.rb activerecord/test/cases/associations/has_one_through_associations_test.rb activerecord/test/cases/reflection_test.rb activerecord/test/cases/relations_test.rb activerecord/test/fixtures/memberships.yml activerecord/test/models/categorization.rb activerecord/test/models/category.rb activerecord/test/models/member.rb activerecord/test/models/reference.rb activerecord/test/models/tagging.rb | ||||
* | Rewrote AssociationPreload. | Jon Leighton | 2011-02-28 | 1 | -0/+66 |