lib/lhm/adapter.rb in departure-4.0.1 vs lib/lhm/adapter.rb in departure-5.0.0

- old
+ new

@@ -1,15 +1,13 @@ require 'lhm/column_with_sql' require 'lhm/column_with_type' module Lhm - # Translates Lhm DSL to ActiveRecord's one, so Lhm migrations will now go # through Percona as well, without any modification on the migration's # code class Adapter - # Constructor # # @param migration [ActiveRecord::Migtration] # @param table_name [String, Symbol] def initialize(migration, table_name) @@ -77,10 +75,10 @@ # # @param columns [Array<String>, Array<Symbol>, String, Symbol] # @param index_name [String] def add_unique_index(columns, index_name = nil) options = { unique: true } - options.merge!(name: index_name) if index_name + options.merge!(name: index_name) if index_name # rubocop:disable Performance/RedundantMerge migration.add_index(table_name, columns, options) end private