aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_methods.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-01-13 16:16:19 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-01-13 16:16:19 -0800
commitbf48af53600e3e535cc4d0cfe9654c40023a7f70 (patch)
tree94db1f852c79c75d100f627615c2ba9cb8d440ec /activerecord/lib/active_record/relation/query_methods.rb
parentaec4aa1702753f29ae79787c743f6f047ad9a80d (diff)
parentf1764a2de17bba07bad3ec0d88de152d8279d3bb (diff)
downloadrails-bf48af53600e3e535cc4d0cfe9654c40023a7f70.tar.gz
rails-bf48af53600e3e535cc4d0cfe9654c40023a7f70.tar.bz2
rails-bf48af53600e3e535cc4d0cfe9654c40023a7f70.zip
Merge branch 'master' into set_binds
* master: (24 commits) unscope should remove bind values associated with the where reverse_order_value= is not private, so no need to send avoid more dynamic symbols no need to to_sym recover from test runs that leave the database in a bad state updates screenshot data [ci skip] "serie" => "series" revises a few things in the getting started guide [ci skip] Favor canonical environment variables for secrets removed extra comma [ci skip] Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665. Updated Changelog to reflect removal of :dependent => :restrict standardize on jruby_skip & rbx_skip fix bug in becomes! when changing from base to subclass. Closes #13272. highlight http://localhost:3000 in README.md. Closes #13643. [ci skip] doc proc/lambda arg on inclusion validation. Closes #13689. [ci skip] Skip Spring App Generator tests on JRuby fixes a typo in a CHANGELOG upgrade SDoc fixes the Gemfile generator templates ... Conflicts: activerecord/test/cases/hot_compatibility_test.rb
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 7571208a88..0f5fe7ea51 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -858,11 +858,11 @@ module ActiveRecord
end
single_val_method = Relation::SINGLE_VALUE_METHODS.include?(scope)
- unscope_code = :"#{scope}_value#{'s' unless single_val_method}="
+ unscope_code = "#{scope}_value#{'s' unless single_val_method}="
case scope
when :order
- self.send(:reverse_order_value=, false)
+ self.reverse_order_value = false
result = []
else
result = [] unless single_val_method
@@ -872,17 +872,19 @@ module ActiveRecord
end
def where_unscoping(target_value)
- target_value_sym = target_value.to_sym
+ target_value = target_value.to_s
where_values.reject! do |rel|
case rel
when Arel::Nodes::In, Arel::Nodes::NotIn, Arel::Nodes::Equality, Arel::Nodes::NotEqual
subrelation = (rel.left.kind_of?(Arel::Attributes::Attribute) ? rel.left : rel.right)
- subrelation.name.to_sym == target_value_sym
+ subrelation.name == target_value
else
raise "unscope(where: #{target_value.inspect}) failed: unscoping #{rel.class} is unimplemented."
end
end
+
+ bind_values.reject! { |col,_| col.name == target_value }
end
def custom_join_ast(table, joins)