instance method preventing_writes?

Ruby on Rails 7.1.6

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

preventing_writes?()

Determines whether writes are currently being prevented.

Returns true if the connection is a replica or returns the value of current_preventing_writes.

Source
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 242
      def preventing_writes?
        return true if replica?
        return false if connection_class.nil?

        connection_class.current_preventing_writes
      end

Defined in activerecord/lib/active_record/connection_adapters/abstract_adapter.rb line 242 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::AbstractAdapter

Type at least 2 characters to search.

↑↓ navigate · open · esc close