lib/birdspotting/reorder_columns.rb in birdspotting-0.1.4 vs lib/birdspotting/reorder_columns.rb in birdspotting-0.1.5
- old
+ new
@@ -33,10 +33,10 @@
def column_types(table_name)
table_definition = ActiveRecord::Base
.connection
.execute("SHOW CREATE TABLE `#{table_name}`")
.to_h[table_name.to_s]
- column_definitions = table_definition.lines.map(&:strip).select { |l| l.starts_with?("`") }
+ column_definitions = table_definition.lines.map(&:strip).select { |l| l.start_with?("`") }
Hash[column_definitions.map { |d| d.match(/`(.*)`\s*(.+?)(,|)\z/)[1, 2] }]
end
def check_if_supported