- 01 4月, 2015 1 次提交
-
-
由 Santosh Wadghule 提交于
- Eager loading was not working for the default_scope (class method) for 'find' & 'find_by' methods. - Fixed these by adding a new check 'respond_to?(:default_scope)'.
-
- 12 3月, 2015 1 次提交
-
-
由 Ben Woosley 提交于
Instead use .scope_attributes? consistently in ActiveRecord to check whether there are attributes currently associated with the scope. Move the implementation of .scope_attributes? and .scope_attributes to ActiveRecord::Scoping because they don't particularly have to do specifically with Named scopes and their only dependency, in the case of .scope_attributes?, and only caller, in the case of .scope_attributes is contained in Scoping.
-
- 07 3月, 2014 2 次提交
- 22 2月, 2014 1 次提交
-
-
由 Matt Jones 提交于
This allows the default scope to be built using the current table alias. Resolves #12770
-
- 01 9月, 2013 1 次提交
-
-
We are checking this when defining the default scope and raising an ArgumentError
-
- 02 7月, 2013 2 次提交
-
-
由 Neeraj Singh 提交于
Calling default_scope without a proc will now raise `ArgumentError`.
-
由 Neeraj Singh 提交于
-
- 09 4月, 2013 2 次提交
- 07 4月, 2013 1 次提交
-
-
由 Agis- 提交于
See #10107.
-
- 24 3月, 2013 1 次提交
-
-
由 Neeraj Singh 提交于
Update comment to reflect that unscoped works with named scope even when named scope is using without block form
-
- 29 1月, 2013 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
- 30 10月, 2012 1 次提交
-
-
由 Alexey Gaziev 提交于
-
- 29 10月, 2012 1 次提交
-
-
由 Nikita Afanasenko 提交于
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.
-
- 22 9月, 2012 1 次提交
-
-
由 Francesco Rodriguez 提交于
-
- 03 8月, 2012 2 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
-
- 02 7月, 2012 1 次提交
-
-
由 Francesco Rodriguez 提交于
-
- 16 6月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
-
- 25 4月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 11 4月, 2012 1 次提交
-
-
由 dcurtis 提交于
-
- 22 3月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
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
-
- 29 12月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
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.
-
- 18 12月, 2011 1 次提交
-
-
由 Hendy Tanata 提交于
-
- 16 12月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-