diff options
author | Willian Gustavo Veiga <beberveiga@gmail.com> | 2018-10-02 12:55:36 -0300 |
---|---|---|
committer | Willian Gustavo Veiga <beberveiga@gmail.com> | 2018-10-02 12:57:37 -0300 |
commit | 2d4df1349efdf8dd2c8cc4503fd5a871b0066500 (patch) | |
tree | 9f71a297cf1bb30f1d59039997a60f97357d0782 /activerecord/lib/active_record/scoping.rb | |
parent | 00c50c2b5966fa1d719c8a58564811c672a0e8c6 (diff) | |
parent | cf608ee34dd833b0357ef4eefa692db33242d2aa (diff) | |
download | rails-2d4df1349efdf8dd2c8cc4503fd5a871b0066500.tar.gz rails-2d4df1349efdf8dd2c8cc4503fd5a871b0066500.tar.bz2 rails-2d4df1349efdf8dd2c8cc4503fd5a871b0066500.zip |
Merge branch 'master' into feature/reselect-method
Diffstat (limited to 'activerecord/lib/active_record/scoping.rb')
-rw-r--r-- | activerecord/lib/active_record/scoping.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/scoping.rb b/activerecord/lib/active_record/scoping.rb index 01ac56570a..9eba1254a4 100644 --- a/activerecord/lib/active_record/scoping.rb +++ b/activerecord/lib/active_record/scoping.rb @@ -12,14 +12,6 @@ module ActiveRecord end module ClassMethods # :nodoc: - def current_scope(skip_inherited_scope = false) - ScopeRegistry.value_for(:current_scope, self, skip_inherited_scope) - end - - def current_scope=(scope) - ScopeRegistry.set_value_for(:current_scope, self, scope) - end - # Collects attributes from scopes that should be applied when creating # an AR instance for the particular class this is called on. def scope_attributes @@ -30,6 +22,15 @@ module ActiveRecord def scope_attributes? current_scope end + + private + def current_scope(skip_inherited_scope = false) + ScopeRegistry.value_for(:current_scope, self, skip_inherited_scope) + end + + def current_scope=(scope) + ScopeRegistry.set_value_for(:current_scope, self, scope) + end end def populate_with_current_scope_attributes # :nodoc: |