Sha256: a0d839166780c86b7da9757cb925cda10c282541832f380d9ff1d5c0da561935

Contents?: true

Size: 901 Bytes

Versions: 2

Compression:

Stored size: 901 Bytes

Contents

# frozen_string_literal: true

module Torque
  module PostgreSQL
    module BoundSchemaReflection
      def add_model_name(table_name, model)
        source = defined?(@pool) ? @pool : @connection
        @schema_reflection.add_model_name(source, table_name, model)
      end

      def dependencies(table_name)
        source = defined?(@pool) ? @pool : @connection
        @schema_reflection.dependencies(source, table_name)
      end

      def associations(table_name)
        source = defined?(@pool) ? @pool : @connection
        @schema_reflection.associations(source, table_name)
      end

      def lookup_model(table_name, scoped_class = '')
        source = defined?(@pool) ? @pool : @connection
        @schema_reflection.lookup_model(source, table_name, scoped_class)
      end
    end

    ActiveRecord::ConnectionAdapters::BoundSchemaReflection.prepend BoundSchemaReflection
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
torque-postgresql-3.4.1 lib/torque/postgresql/schema_cache/bound_schema_reflection.rb
torque-postgresql-3.4.0 lib/torque/postgresql/schema_cache/bound_schema_reflection.rb