instance method
preventing_writes?
Ruby on Rails 6.0.6
Since v6.0.6Signature
preventing_writes?()
Determines whether writes are currently being prevents.
Returns true if the connection is a replica, or if prevent_writes is set to true.
Source
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 157
def preventing_writes?
replica? || ActiveRecord::Base.connection_handler.prevent_writes
end
Defined in activerecord/lib/active_record/connection_adapters/abstract_adapter.rb line 157
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::AbstractAdapter