Module: Torque::PostgreSQL::BoundSchemaReflection

Included in:
ActiveRecord::ConnectionAdapters::BoundSchemaReflection
Defined in:
lib/torque/postgresql/schema_cache/bound_schema_reflection.rb,
sig/torque/postgresql/schema_cache/bound_schema_reflection.rbs

Instance Method Summary collapse

Instance Method Details

#add_model_name(table_name, model) ⇒ model?

Parameters:

  • table_name (String)
  • model (model)

Returns:

  • (model, nil)


6
7
8
9
# File 'lib/torque/postgresql/schema_cache/bound_schema_reflection.rb', line 6

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

#associations(table_name) ⇒ Array[String]?

Parameters:

  • table_name (String)

Returns:

  • (Array[String], nil)


16
17
18
19
# File 'lib/torque/postgresql/schema_cache/bound_schema_reflection.rb', line 16

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

#dependencies(table_name) ⇒ Array[String]?

Parameters:

  • table_name (String)

Returns:

  • (Array[String], nil)


11
12
13
14
# File 'lib/torque/postgresql/schema_cache/bound_schema_reflection.rb', line 11

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

#lookup_model(table_name, scoped_class = '') ⇒ model

Parameters:

  • table_name (String)
  • scoped_class (String, model) (defaults to: '')

Returns:

  • (model)


21
22
23
24
# File 'lib/torque/postgresql/schema_cache/bound_schema_reflection.rb', line 21

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