aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/scoping/default.rb
Commit message (Collapse)AuthorAgeFilesLines
* calling default_scope without a proc will raise ArgumentErrorNeeraj Singh2013-07-021-3/+2
| | | | Calling default_scope without a proc will now raise `ArgumentError`.
* Removed deprecated method default_scopes?Neeraj Singh2013-07-011-8/+0
|
* Delegating the value getter and setters in the ScopeRegistry to thewangjohn2013-04-081-2/+2
| | | | current ScopeRegister object.
* Grouping thread locals in the ActiveRecord scopes so that thewangjohn2013-04-081-2/+2
| | | | | current_scope and ignore_default_scope locals are brought together under a registry object.
* Deprecate ActiveRecord#Base.default_scopes?Agis-2013-04-061-1/+10
| | | | See #10107.
* unscoped works with named scope [ci skip]Neeraj Singh2013-03-231-8/+0
| | | | | Update comment to reflect that unscoped works with named scope even when named scope is using without block form
* Refactor to use each_key, remove extra spacesCarlos Antonio da Silva2013-01-281-3/+1
|
* Make caller attribute in deprecation methods optionalAlexey Gaziev2012-10-301-2/+1
|
* Provide a call stack for deprecation warnings where needed.Nikita Afanasenko2012-10-291-1/+2
| | | | It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
* update AR::Scoping documentation [ci skip]Francesco Rodriguez2012-09-211-26/+29
|
* load active_support/deprecation in active_support/railsXavier Noria2012-08-021-1/+0
|
* load active_support/concern in active_support/railsXavier Noria2012-08-021-1/+0
|
* remove :nodoc: of AR::Scoping#unscoped [ci skip]Francesco Rodriguez2012-07-011-4/+4
|
* Simplify AR configuration code.Jon Leighton2012-06-151-1/+1
| | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
* extract to active_record_deprecated_findersJon Leighton2012-04-251-6/+5
|
* giving a hash to default scope should not be deprecated (well, not for this ↵Jon Leighton2012-04-251-1/+1
| | | | reason)
* Corrected grammatical errors in schema_dumper and scoping/defaultdcurtis2012-04-101-1/+1
|
* Deprecate eager-evaluated scopes.Jon Leighton2012-03-211-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 Leighton2011-12-281-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 Tanata2011-12-181-6/+8
|
* Move DefaultScope and NamedScope under ScopingJon Leighton2011-12-151-0/+140