Skip to content

Commit fdb099a

Browse files
authored
chore: Rename Idem Potent to Idempotent (#55)
It's more commonly used as a single English word https://en.wiktionary.org/wiki/idempotent rather than two Latin words.
1 parent 07a3551 commit fdb099a

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

lib/safe-pg-migrations/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
require 'safe-pg-migrations/plugins/blocking_activity_logger'
77
require 'safe-pg-migrations/plugins/statement_insurer'
88
require 'safe-pg-migrations/plugins/statement_retrier'
9-
require 'safe-pg-migrations/plugins/idem_potent_statements'
9+
require 'safe-pg-migrations/plugins/idempotent_statements'
1010
require 'safe-pg-migrations/plugins/useless_statements_logger'
1111

1212
module SafePgMigrations
1313
# Order matters: the bottom-most plugin will have precedence
1414
PLUGINS = [
1515
BlockingActivityLogger,
16-
IdemPotentStatements,
16+
IdempotentStatements,
1717
StatementRetrier,
1818
StatementInsurer,
1919
UselessStatementsLogger,

lib/safe-pg-migrations/plugins/idem_potent_statements.rb renamed to lib/safe-pg-migrations/plugins/idempotent_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
module SafePgMigrations
4-
module IdemPotentStatements
4+
module IdempotentStatements
55
ruby2_keywords def add_index(table_name, column_name, *args)
66
options = args.last.is_a?(Hash) ? args.last : {}
77
index_name = options.key?(:name) ? options[:name].to_s : index_name(table_name, index_column_names(column_name))

test/add_foreign_key_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def change
105105
], calls
106106
end
107107

108-
def test_add_foreign_key_idem_potent
108+
def test_add_foreign_key_idempotent
109109
@connection.create_table(:users) { |t| t.string :email }
110110
@connection.create_table(:messages) do |t|
111111
t.string :message
@@ -147,7 +147,7 @@ def change
147147
], write_calls.map(&:first).values_at(0, 1, 3, 4)
148148
end
149149

150-
def test_add_foreign_key_idem_potent_with_column_option
150+
def test_add_foreign_key_idempotent_with_column_option
151151
@connection.create_table(:users) { |t| t.string :email }
152152
@connection.create_table(:messages) do |t|
153153
t.string :message
@@ -190,7 +190,7 @@ def change
190190
], write_calls.map(&:first).values_at(0, 1, 3, 4)
191191
end
192192

193-
def test_add_foreign_key_idem_potent_with_other_options
193+
def test_add_foreign_key_idempotent_with_other_options
194194
@connection.create_table(:users) { |t| t.string :email }
195195
@connection.create_table(:messages) do |t|
196196
t.string :message
@@ -234,7 +234,7 @@ def change
234234
], write_calls.map(&:first).values_at(0, 1, 3, 4)
235235
end
236236

237-
def test_add_foreign_key_idem_potent_different_tables
237+
def test_add_foreign_key_idempotent_different_tables
238238
@connection.create_table(:users) { |t| t.string :email }
239239
@connection.create_table(:conversations) { |t| t.string :subject }
240240
@connection.create_table(:messages) do |t|

test/safe_pg_migrations_test.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def up
268268
end
269269
end
270270

271-
def test_create_table_idem_potent
271+
def test_create_table_idempotent
272272
@connection.create_table(:users) { |t| t.string :email }
273273
@migration =
274274
Class.new(ActiveRecord::Migration::Current) do
@@ -289,7 +289,7 @@ def change
289289
], write_calls[0...4]
290290
end
291291

292-
def test_add_column_idem_potent
292+
def test_add_column_idempotent
293293
@connection.create_table(:users) { |t| t.string :email }
294294
@migration =
295295
Class.new(ActiveRecord::Migration::Current) do
@@ -310,7 +310,7 @@ def change
310310
], write_calls[3..4]
311311
end
312312

313-
def test_remove_column_idem_potent
313+
def test_remove_column_idempotent
314314
@connection.create_table(:users) { |t| t.string :email, index: true }
315315
@migration =
316316
Class.new(ActiveRecord::Migration::Current) do
@@ -336,7 +336,7 @@ def change
336336
refute @connection.index_exists?(:users, :email)
337337
end
338338

339-
def test_remove_index_idem_potent
339+
def test_remove_index_idempotent
340340
@connection.create_table(:users) { |t| t.string(:email, index: true) }
341341
@migration =
342342
Class.new(ActiveRecord::Migration::Current) do
@@ -417,7 +417,7 @@ def change
417417
refute @connection.index_exists?(:users, :email)
418418
end
419419

420-
def test_add_index_idem_potent
420+
def test_add_index_idempotent
421421
@connection.create_table(:users) { |t| t.string :email }
422422
@migration =
423423
Class.new(ActiveRecord::Migration::Current) do
@@ -459,7 +459,7 @@ def change
459459
], calls
460460
end
461461

462-
def test_add_index_idem_potent_invalid_index
462+
def test_add_index_idempotent_invalid_index
463463
@connection.create_table(:users) { |t| t.string :email, index: true }
464464

465465
@migration =

0 commit comments

Comments
 (0)