diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-06-26 02:23:35 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-06-26 02:23:35 +0900 |
commit | 5dafa72935fbb0656f814f26f94e46f545890214 (patch) | |
tree | 50192a0e6488643d674fd6408379aed85dc87f12 /activerecord/lib | |
parent | 98d12f1ef31014287c897fc60df4e1af70781ca3 (diff) | |
download | rails-5dafa72935fbb0656f814f26f94e46f545890214.tar.gz rails-5dafa72935fbb0656f814f26f94e46f545890214.tar.bz2 rails-5dafa72935fbb0656f814f26f94e46f545890214.zip |
Fix extracting `references` via `order_values` to respect quoting
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 6ccdd7adcb..d44f6fd572 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -1122,7 +1122,7 @@ module ActiveRecord validate_order_args(order_args) references = order_args.grep(String) - references.map! { |arg| arg =~ /^([a-zA-Z]\w*)\.(\w+)/ && $1 }.compact! + references.map! { |arg| arg =~ /^\W?(\w+)\W?\./ && $1 }.compact! references!(references) if references.any? # if a symbol is given we prepend the quoted table name |