Array#to_h is new in Ruby 2.1, we still suppport 2.0

This commit is contained in:
Jonne Haß 2015-03-15 15:59:06 +01:00
parent c3bf9dd831
commit 414cfbdae0

View file

@ -37,12 +37,12 @@ class SetMysqlToUnicodeMb4 < ActiveRecord::Migration
def character_columns def character_columns
# build a hash with all the columns that contain characters # build a hash with all the columns that contain characters
@character_columns ||= tables.map {|table| @character_columns ||= Hash[tables.map {|table|
col = columns(table) col = columns(table)
.select {|column| column.type == :string || column.type == :text } .select {|column| column.type == :string || column.type == :text }
next if col.empty? next if col.empty?
[table, col] [table, col]
}.compact.to_h }.compact]
end end
def shorten_indexes def shorten_indexes