aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/association_proxy.rb4
-rw-r--r--activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb2
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb2
-rw-r--r--activerecord/lib/active_record/associations/has_many_through_association.rb2
-rwxr-xr-xactiverecord/lib/active_record/base.rb6
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb2
6 files changed, 5 insertions, 13 deletions
diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb
index 96cbd3043a..1fe1fee748 100644
--- a/activerecord/lib/active_record/associations/association_proxy.rb
+++ b/activerecord/lib/active_record/associations/association_proxy.rb
@@ -98,10 +98,6 @@ module ActiveRecord
@reflection.klass.send(:sanitize_sql, sql)
end
- def extract_options_from_args!(args)
- @owner.send(:extract_options_from_args!, args)
- end
-
def set_belongs_to_association_for(record)
if @reflection.options[:as]
record["#{@reflection.options[:as]}_id"] = @owner.id unless @owner.new_record?
diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
index b5f718ae52..d06af335ef 100644
--- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
@@ -29,7 +29,7 @@ module ActiveRecord
end
def find(*args)
- options = Base.send(:extract_options_from_args!, args)
+ options = args.extract_options!
# If using a custom finder_sql, scan the entire collection.
if @reflection.options[:finder_sql]
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb
index 393d59b084..838eb00863 100644
--- a/activerecord/lib/active_record/associations/has_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_association.rb
@@ -38,7 +38,7 @@ module ActiveRecord
end
def find(*args)
- options = Base.send(:extract_options_from_args!, args)
+ options = args.extract_options!
# If using a custom finder_sql, scan the entire collection.
if @reflection.options[:finder_sql]
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb
index 3d60da76b3..ebe1be04e5 100644
--- a/activerecord/lib/active_record/associations/has_many_through_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -9,7 +9,7 @@ module ActiveRecord
end
def find(*args)
- options = Base.send(:extract_options_from_args!, args)
+ options = args.extract_options!
conditions = "#{@finder_sql}"
if sanitized_conditions = sanitize_sql(options[:conditions])
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 5ab761932f..5319ec6ec2 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -421,7 +421,7 @@ module ActiveRecord #:nodoc:
# person.save!
# end
def find(*args)
- options = extract_options_from_args!(args)
+ options = args.extract_options!
validate_find_options(options)
set_readonly_option!(options)
@@ -1604,10 +1604,6 @@ module ActiveRecord #:nodoc:
end
end
- def extract_options_from_args!(args) #:nodoc:
- args.last.is_a?(Hash) ? args.pop : {}
- end
-
VALID_FIND_OPTIONS = [ :conditions, :include, :joins, :limit, :offset,
:order, :select, :readonly, :group, :from, :lock ]
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index b6c3949a5a..d4143cee3c 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -364,7 +364,7 @@ module ActiveRecord
%w( string text integer float decimal datetime timestamp time date binary boolean ).each do |column_type|
class_eval <<-EOV
def #{column_type}(*args)
- options = args.last.is_a?(Hash) ? args.pop : {}
+ options = args.extract_options!
column_names = args
column_names.each { |name| column(name, '#{column_type}', options) }