Array#to_h is new in Ruby 2.1, we still suppport 2.0
This commit is contained in:
parent
c3bf9dd831
commit
414cfbdae0
1 changed files with 2 additions and 2 deletions
|
|
@ -37,12 +37,12 @@ class SetMysqlToUnicodeMb4 < ActiveRecord::Migration
|
|||
|
||||
def character_columns
|
||||
# build a hash with all the columns that contain characters
|
||||
@character_columns ||= tables.map {|table|
|
||||
@character_columns ||= Hash[tables.map {|table|
|
||||
col = columns(table)
|
||||
.select {|column| column.type == :string || column.type == :text }
|
||||
next if col.empty?
|
||||
[table, col]
|
||||
}.compact.to_h
|
||||
}.compact]
|
||||
end
|
||||
|
||||
def shorten_indexes
|
||||
|
|
|
|||
Loading…
Reference in a new issue