preventing_writes?(class_name)
public
Intended to behave like `.current_preventing_writes` given the class name
as input. See PoolConfig and ConnectionHandler::ConnectionDescriptor.
# File activerecord/lib/active_record/core.rb, line 206
def self.preventing_writes?(class_name) # :nodoc:
connected_to_stack.reverse_each do |hash|
return hash[:prevent_writes] if !hash[:prevent_writes].nil? && hash[:klasses].include?(Base)
return hash[:prevent_writes] if !hash[:prevent_writes].nil? && hash[:klasses].any? { |klass| klass.name == class_name }
end
false
end