Method: Webhookdb::Console.unsafe

Defined in:
lib/webhookdb/console.rb

.unsafe(&block) ⇒ Object

Raises:

  • (LocalJumpError)


48
49
50
51
52
53
54
55
56
# File 'lib/webhookdb/console.rb', line 48

def self.unsafe(&block)
  raise LocalJumpError, "unsafe must be called with a block (do ... end)" unless block
  self.unsafe_mode = true
  begin
    Webhookdb::Postgres::Model.db.transaction(&block)
  ensure
    self.unsafe_mode = false
  end
end