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 70e48de9400076f327d248e1b0ecdf7d1dc0fed6..6bda8888b7338d9c332f70bd8cf3e8584f6b70fb 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -1015,6 +1015,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