Module: ActiveRecordShards::SqlComments

Defined in:
lib/active_record_shards/sql_comments.rb

Defined Under Namespace

Modules: Methods

Class Method Summary collapse

Class Method Details

.enableObject



15
16
17
18
19
20
21
# File 'lib/active_record_shards/sql_comments.rb', line 15

def self.enable
  ActiveRecord::Base.on_replica do
    ActiveRecord::Base.on_shard(nil) do
      ActiveRecord::Base.connection.class.prepend(Methods)
    end
  end
end