Module: Mbeditor::PendingMigrations

Defined in:
lib/mbeditor/pending_migrations.rb

Overview

The last pending-migration message seen, so the editor can warn about it without being blocked by it.

Lives in lib/ (not autoloaded) for the same reason ExceptionLog does: a Zeitwerk reload must not wipe it, and a pending migration is exactly the state in which reloads are happening.

Class Method Summary collapse

Class Method Details

.clearObject



21
22
23
# File 'lib/mbeditor/pending_migrations.rb', line 21

def clear
  MUTEX.synchronize { @message = nil }
end

.messageObject



25
26
27
# File 'lib/mbeditor/pending_migrations.rb', line 25

def message
  MUTEX.synchronize { @message }
end

.note(message) ⇒ Object

message: the PendingMigrationError's message, or nil once it clears.



17
18
19
# File 'lib/mbeditor/pending_migrations.rb', line 17

def note(message)
  MUTEX.synchronize { @message = message && message.to_s.strip }
end

.pending?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/mbeditor/pending_migrations.rb', line 29

def pending?
  !message.nil?
end