Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Allow unscope to work with `where.not` | Eric Hankins | 2013-10-21 | 1 | -6/+14 | |
| | | | | | | Allows you to call #unscope on a relation with negative equality operators, i.e. Arel::Nodes::NotIn and Arel::Nodes::NotEqual that have been generated through the use of where.not. | |||||
* | asakusa.rb hack night! | Aaron Patterson + Akira Matsuda | 2013-08-06 | 1 | -0/+2 | |
| | | | | Fix in-memory tests | |||||
* | Revert change on ActiveRecord::Relation#order method that prepends new | Rafael Mendonça França | 2013-07-29 | 1 | -4/+4 | |
| | | | | | | | | | | | | | | | order on the old ones The previous behavior added a major backward incompatibility since it impossible to have a upgrade path without major changes on the application code. We are taking the most conservative path to be consistent with the idea of having a smoother upgrade on Rails 4. We are reverting the behavior for what was in Rails 3.x and, if needed, we will implement a new API to prepend the order clauses in Rails 4.1. | |||||
* | close our connection when we are done | Aaron Patterson | 2013-07-08 | 1 | -1/+6 | |
| | ||||||
* | Simplify/fix implementation of default scopes | Jon Leighton | 2013-06-28 | 1 | -3/+2 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | |||||
* | Delegate #unscope query method | Carlos Antonio da Silva | 2013-04-28 | 1 | -0/+10 | |
| | ||||||
* | split relation_scoping_test.rb's default scoping tests into another file | Takehiro Adachi | 2013-03-30 | 1 | -0/+360 | |