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
- .clear ⇒ Object
- .message ⇒ Object
-
.note(message) ⇒ Object
message: the PendingMigrationError's message, or nil once it clears.
- .pending? ⇒ Boolean
Class Method Details
.clear ⇒ Object
21 22 23 |
# File 'lib/mbeditor/pending_migrations.rb', line 21 def clear MUTEX.synchronize { @message = nil } end |
.message ⇒ Object
25 26 27 |
# File 'lib/mbeditor/pending_migrations.rb', line 25 def 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() MUTEX.synchronize { @message = && .to_s.strip } end |
.pending? ⇒ Boolean
29 30 31 |
# File 'lib/mbeditor/pending_migrations.rb', line 29 def pending? !.nil? end |