Method: Sequel::QueryBlocker#block_queries
- Defined in:
- lib/sequel/extensions/query_blocker.rb
#block_queries(opts = OPTS, &block) ⇒ Object
Reject (raise an BlockedQuery exception) if there is an attempt to execute a query/statement inside the block.
The :scope option indicates which queries are rejected inside the block:
- :global
-
This is the default, and rejects all queries.
- :thread
-
Reject all queries in the current thread.
- :fiber
-
Reject all queries in the current fiber.
- Thread
-
Reject all queries in the given thread.
- Fiber
-
Reject all queries in the given fiber.
119 120 121 |
# File 'lib/sequel/extensions/query_blocker.rb', line 119 def block_queries(opts=OPTS, &block) _allow_or_block_queries(true, opts, &block) end |