Sha256: c817b2e23cc2cfb3573b0b610fe4d296ec39f92a3dec0189a8d5416b73a933a8

Contents?: true

Size: 574 Bytes

Versions: 2

Compression:

Stored size: 574 Bytes

Contents

patche_targets = %w[
  active_record/base
  active_record/relation
  arel/nodes/select_core
  arel/visitors/mysql
  arel/select_manager
]

ActiveSupport.on_load :active_record do
  patche_targets.each do |target|
    require target
    require_relative "./activerecord-mysql-sql-cache/patches/#{target}.rb"

    camelized_target = target.camelize
    camelized_target.gsub!('Mysql', 'MySQL')
    target_cls = camelized_target.constantize
    patch_mod = "ActiverecordMysqlSqlCache::Patches::#{camelized_target}".constantize
    target_cls.send :include, patch_mod
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-mysql-sql-cache-0.1.1 lib/activerecord-mysql-sql-cache.rb
activerecord-mysql-sql-cache-0.1.0 lib/activerecord-mysql-sql-cache.rb