Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #4843 from seamusabshere/patch-1

Possibly clearer way of getting rid of ` and "
  • Loading branch information...
commit bbd2caeaf916980b4c55ffce2b8fd9097082f27a 2 parents ddaeb4b + 602e038
@fxn fxn authored
View
2  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
Please sign in to comment.
Something went wrong with that request. Please try again.