Sha256: 9f04cb1d15b32f1796c75f9639761f2de9b74994effcae0bb24e0e1759470d8b

Contents?: true

Size: 597 Bytes

Versions: 1

Compression:

Stored size: 597 Bytes

Contents

module ConnectionManager
  module Core
    # We want to make sure we get the full table name with schema
    def arel_table_with_check_name # :nodoc:
      @arel_table = Arel::Table.new(table_name, arel_engine) unless (@arel_table && (@arel_table.name == self.table_name))
      @arel_table
    end

    def self.included(base)
      base.alias_method_chain :arel_table, :check_name
    end

    def self.extended(base)
      class << base
        self.alias_method_chain :arel_table, :check_name
      end
    end
  end
end
ActiveRecord::Core::ClassMethods.send(:include,ConnectionManager::Core)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
connection_manager-2.0.0 lib/connection_manager/core.rb