diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index 3da017b8999e12bfc4ccdc663161c96c4a06d51f..31fb946ce63311ee099a12adcee493ec1ea572b2 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -1035,6 +1035,12 @@ def prevent_writes=(prevent_writes) # :nodoc: # In some cases you may want to prevent writes to the database # even if you are on a database that can write. `while_preventing_writes` # will prevent writes to the database for the duration of the block. + # + # This method does not provide the same protection as a readonly + # user and is meant to be a safeguard against accidental writes. + # + # See `READ_QUERY` for the queries that are blocked by this + # method. def while_preventing_writes(enabled = true) original, self.prevent_writes = self.prevent_writes, enabled yield