Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | modernizes hash syntax in activerecord | Xavier Noria | 2016-08-06 | 1 | -1/+1 |
| | |||||
* | Deprecate eager-evaluated scopes. | Jon Leighton | 2012-03-21 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use this: scope :red, where(color: 'red') default_scope where(color: 'red') Use this: scope :red, -> { where(color: 'red') } default_scope { where(color: 'red') } The former has numerous issues. It is a common newbie gotcha to do the following: scope :recent, where(published_at: Time.now - 2.weeks) Or a more subtle variant: scope :recent, -> { where(published_at: Time.now - 2.weeks) } scope :recent_red, recent.where(color: 'red') Eager scopes are also very complex to implement within Active Record, and there are still bugs. For example, the following does not do what you expect: scope :remove_conditions, except(:where) where(...).remove_conditions # => still has conditions | ||||
* | Un-deprecate using 'default_scope' as a macro, but if you are calling the ↵ | Jon Leighton | 2011-04-18 | 1 | -3/+1 |
| | | | | macro multiple times that will give deprecation warnings, and in 3.2 we will simply overwrite the default scope when you call the macro multiple times. | ||||
* | Deprecated support for passing hashes and relations to default_scope, in ↵ | Jon Leighton | 2011-04-12 | 1 | -2/+4 |
| | | | | favour of defining a 'default_scope' class method in the model. See the CHANGELOG for more details. | ||||
* | Push a failing test for issues [#4994] and [#5003]. | José Valim | 2010-06-29 | 1 | -0/+3 |