aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-03-28 16:01:05 -0700
committerXavier Noria <fxn@hashref.com>2012-03-28 16:01:05 -0700
commitbbd2caeaf916980b4c55ffce2b8fd9097082f27a (patch)
treebc8160fa802b69a26b00666811480235310201ed /activerecord/lib/active_record/connection_adapters
parentddaeb4b6cf6c1a1779c6e46ff49e8c5f5e0b7418 (diff)
parent602e038ac5f0f801fe110243557c8751c793bc0a (diff)
downloadrails-bbd2caeaf916980b4c55ffce2b8fd9097082f27a.tar.gz
rails-bbd2caeaf916980b4c55ffce2b8fd9097082f27a.tar.bz2
rails-bbd2caeaf916980b4c55ffce2b8fd9097082f27a.zip
Merge pull request #4843 from seamusabshere/patch-1
Possibly clearer way of getting rid of ` and "
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
index 731c07547a..64f922b7ad 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -526,7 +526,7 @@ module ActiveRecord
execute_and_free("SHOW CREATE TABLE #{quote_table_name(table)}", 'SCHEMA') do |result|
create_table = each_hash(result).first[:"Create Table"]
if create_table.to_s =~ /PRIMARY KEY\s+\((.+)\)/
- keys = $1.split(",").map { |key| key.gsub(/[`"]/, "") }
+ keys = $1.split(",").map { |key| key.delete('`"') }
keys.length == 1 ? [keys.first, nil] : nil
else
nil