Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | cache associated target records hash | Aaron Patterson | 2013-09-20 | 1 | -17/+11 |
| | |||||
* | preserve order on the RHS query | Aaron Patterson | 2013-09-20 | 1 | -0/+8 |
| | |||||
* | push `run` up to preload | Aaron Patterson | 2013-09-20 | 1 | -3/+7 |
| | |||||
* | exposing target records on the preloader | Aaron Patterson | 2013-09-20 | 1 | -14/+27 |
| | |||||
* | correctly typecast keys, remove conditionals, reduce object allocations | Aaron Patterson | 2013-08-28 | 1 | -7/+6 |
| | |||||
* | no need to to_a the scope | Aaron Patterson | 2013-08-28 | 1 | -1/+1 |
| | |||||
* | remove extra flat_map array | Aaron Patterson | 2013-08-28 | 1 | -8/+9 |
| | |||||
* | avoid extra empty array allocation | Aaron Patterson | 2013-08-28 | 1 | -10/+10 |
| | |||||
* | extract owner id calculation to a method | Aaron Patterson | 2013-08-28 | 1 | -1/+5 |
| | |||||
* | only call to_a when we have to | Aaron Patterson | 2013-08-28 | 1 | -1/+5 |
| | |||||
* | use flat_map | Neeraj Singh | 2013-08-03 | 1 | -1/+1 |
| | |||||
* | Simplify/fix implementation of default scopes | Jon Leighton | 2013-06-28 | 1 | -2/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation was necessary in order to support stuff like: class Post < ActiveRecord::Base default_scope where(published: true) scope :ordered, order("created_at") end If we didn't evaluate the default scope at the last possible moment before sending the SQL to the database, it would become impossible to do: Post.unscoped.ordered This is because the default scope would already be bound up in the "ordered" scope, and therefore wouldn't be removed by the "Post.unscoped" part. In 4.0, we have deprecated all "eager" forms of scopes. So now you must write: class Post < ActiveRecord::Base default_scope { where(published: true) } scope :ordered, -> { order("created_at") } end This prevents the default scope getting bound up inside the "ordered" scope, which means we can now have a simpler/better/more natural implementation of default scoping. A knock on effect is that some things that didn't work properly now do. For example it was previously impossible to use #except to remove a part of the default scope, since the default scope was evaluated after the call to #except. | ||||
* | Eager loading made to use relation's in_clause_length instead of host's one ↵ | Boris Staal | 2012-12-20 | 1 | -1/+1 |
| | | | | (fixes #8474) | ||||
* | Revert "Use flat_map { } instead of map {}.flatten" | Santiago Pastorino | 2012-10-05 | 1 | -1/+1 |
| | | | | | | | | | | | This reverts commit abf8de85519141496a6773310964ec03f6106f3f. We should take a deeper look to those cases flat_map doesn't do deep flattening. irb(main):002:0> [[[1,3], [1,2]]].map{|i| i}.flatten => [1, 3, 1, 2] irb(main):003:0> [[[1,3], [1,2]]].flat_map{|i| i} => [[1, 3], [1, 2]] | ||||
* | Use flat_map { } instead of map {}.flatten | Santiago Pastorino | 2012-10-05 | 1 | -1/+1 |
| | |||||
* | s/scoped/scope/ | Jon Leighton | 2012-08-01 | 1 | -4/+4 |
| | |||||
* | Convert association macros to the new syntax | Jon Leighton | 2012-07-20 | 1 | -1/+1 |
| | |||||
* | Represent association scope options as AR::Relations insternally. | Jon Leighton | 2012-07-13 | 1 | -27/+22 |
| | |||||
* | Fix #5667. Preloading should ignore scoping. | Jon Leighton | 2012-03-30 | 1 | -2/+3 |
| | |||||
* | Avoid sanitize_sql when we can use Relation#where instead | Jon Leighton | 2012-01-16 | 1 | -8/+6 |
| | |||||
* | 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 |
| | |||||
* | reduce calls to owners_by_key and to read_attribute, respond_to? etc | Aaron Patterson | 2011-07-01 | 1 | -2/+3 |
| | |||||
* | Rewrote AssociationPreload. | Jon Leighton | 2011-02-28 | 1 | -0/+126 |