Class: ActiveRecord::TableMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/composite_primary_keys/table_metadata.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#associated_with?(table_name) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
# File 'lib/composite_primary_keys/table_metadata.rb', line 5

def associated_with?(table_name)
  # CPK
  # klass&._reflect_on_association(table_name) || klass&._reflect_on_association(table_name.singularize)
  klass&._reflect_on_association(table_name) || klass&._reflect_on_association(table_name.to_s.singularize)
end