Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Simplify AR configuration code. | Jon Leighton | 2012-06-15 | 1 | -1/+1 |
| | | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc. | ||||
* | extract to active_record_deprecated_finders | Jon Leighton | 2012-04-25 | 1 | -6/+5 |
| | |||||
* | giving a hash to default scope should not be deprecated (well, not for this ↵ | Jon Leighton | 2012-04-25 | 1 | -1/+1 |
| | | | | reason) | ||||
* | Corrected grammatical errors in schema_dumper and scoping/default | dcurtis | 2012-04-10 | 1 | -1/+1 |
| | |||||
* | Deprecate eager-evaluated scopes. | Jon Leighton | 2012-03-21 | 1 | -10/+15 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | ||||
* | Support configuration on ActiveRecord::Model. | Jon Leighton | 2011-12-28 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | The problem: We need to be able to specify configuration in a way that can be inherited to models that include ActiveRecord::Model. So it is no longer sufficient to put 'top level' config on ActiveRecord::Base, but we do want configuration specified on ActiveRecord::Base and descendants to continue to work. So we need something like class_attribute that can be defined on a module but that is inherited when ActiveRecord::Model is included. The solution: added ActiveModel::Configuration module which provides a config_attribute macro. It's a bit specific hence I am not putting this in Active Support or making it a 'public API' at present. | ||||
* | Improve doc for ActiveRecord::Base.unscoped. | Hendy Tanata | 2011-12-18 | 1 | -6/+8 |
| | |||||
* | Move DefaultScope and NamedScope under Scoping | Jon Leighton | 2011-12-15 | 1 | -0/+140 |