Permalink
Browse files

Merge pull request #4843 from seamusabshere/patch-1

Possibly clearer way of getting rid of ` and "
  • Loading branch information...
2 parents ddaeb4b + 602e038 commit bbd2caeaf916980b4c55ffce2b8fd9097082f27a @fxn fxn committed Mar 28, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -526,7 +526,7 @@ def pk_and_sequence_for(table)
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

0 comments on commit bbd2cae

Please sign in to comment.