~cytrogen/masto-fe

ref: 23197cebce60708ff9b3965f1ac4446ad03730a0 masto-fe/app/helpers/database_helper.rb -rw-r--r-- 266 bytes
23197ceb — Claire Reduce dropdown menu margin and padding (#2301) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

module DatabaseHelper
  def with_read_replica(&block)
    ApplicationRecord.connected_to(role: :read, prevent_writes: true, &block)
  end

  def with_primary(&block)
    ApplicationRecord.connected_to(role: :primary, &block)
  end
end