aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-04-12 15:02:00 +0100
committerJon Leighton <j@jonathanleighton.com>2012-04-12 15:02:00 +0100
commiteda65f391edc1a4ba21fc51f076a442034095826 (patch)
tree69ccfd5c636ff8466258a310e12e37229eec2df2
parentdd2c9b9578d423c60c3a5eb19a7841e8a61faadf (diff)
downloadrails-eda65f391edc1a4ba21fc51f076a442034095826.tar.gz
rails-eda65f391edc1a4ba21fc51f076a442034095826.tar.bz2
rails-eda65f391edc1a4ba21fc51f076a442034095826.zip
move apply_finder_options to active_record_deprecated_finders
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb22
1 files changed, 0 insertions, 22 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb
index 03ba8c8628..19ec41e5ca 100644
--- a/activerecord/lib/active_record/relation/spawn_methods.rb
+++ b/activerecord/lib/active_record/relation/spawn_methods.rb
@@ -128,27 +128,5 @@ module ActiveRecord
result
end
- VALID_FIND_OPTIONS = [ :conditions, :include, :joins, :limit, :offset, :extend, :references,
- :order, :select, :readonly, :group, :having, :from, :lock ]
-
- def apply_finder_options(options)
- relation = clone
- return relation unless options
-
- options.assert_valid_keys(VALID_FIND_OPTIONS)
- finders = options.dup
- finders.delete_if { |key, value| value.nil? && key != :limit }
-
- ((VALID_FIND_OPTIONS - [:conditions, :include, :extend]) & finders.keys).each do |finder|
- relation = relation.send(finder, finders[finder])
- end
-
- relation = relation.where(finders[:conditions]) if options.has_key?(:conditions)
- relation = relation.includes(finders[:include]) if options.has_key?(:include)
- relation = relation.extending(finders[:extend]) if options.has_key?(:extend)
-
- relation
- end
-
end
end