aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-16 04:38:16 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-16 04:38:16 +0530
commit81cd11259c52544dd1bc401b7097e4a0e5d34fe6 (patch)
tree0df7c7d35dfb73c460b09db3db88e610ca9ceec0 /activerecord/lib
parent2d0bc08a7e1a0ecee577674deba2c0a17fe665e4 (diff)
downloadrails-81cd11259c52544dd1bc401b7097e4a0e5d34fe6.tar.gz
rails-81cd11259c52544dd1bc401b7097e4a0e5d34fe6.tar.bz2
rails-81cd11259c52544dd1bc401b7097e4a0e5d34fe6.zip
Remove protected method Class#scoped?
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 4a53a7bd22..6ecd5061d4 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1846,14 +1846,6 @@ module ActiveRecord #:nodoc:
self.default_scoping << construct_finder_arel(options)
end
- # Test whether the given method and optional key are scoped.
- def scoped?(method, key = nil) #:nodoc:
- case method
- when :create
- current_scoped_methods.send(:scope_for_create).present? if current_scoped_methods
- end
- end
-
def scoped_methods #:nodoc:
Thread.current[:"#{self}_scoped_methods"] ||= self.default_scoping.dup
end
@@ -2111,7 +2103,11 @@ module ActiveRecord #:nodoc:
@attributes_cache = {}
@new_record = true
ensure_proper_type
- self.class.send(:scope, :create).each { |att, value| self.send("#{att}=", value) } if self.class.send(:scoped?, :create)
+
+ if scope = self.class.send(:current_scoped_methods)
+ create_with = scope.scope_for_create
+ create_with.each { |att,value| self.send("#{att}=", value) } if create_with
+ end
end
# Returns a String, which Action Pack uses for constructing an URL to this