Module: Dart::NamingConventions::ManyToOneAssociationHelpers

Includes:
AssociationHelpers, DirectAssociationHelpers
Included in:
Database::ManyToOneAssociation
Defined in:
lib/dart/naming_conventions/many_to_one_association_helpers.rb

Instance Method Summary collapse

Methods included from DirectAssociationHelpers

#conventional_foreign_key?, #conventional_parent?, #conventional_primary_key?

Methods included from AssociationHelpers

#naming_conventions, #set_conventional_name!

Instance Method Details

#conventional_nameString

Returns the name of a referenced association according to the naming convention

Returns:

  • (String)

    the name of the referenced association



11
12
13
# File 'lib/dart/naming_conventions/many_to_one_association_helpers.rb', line 11

def conventional_name
  naming_conventions.singular_association_name(foreign_key)
end

#name_is_conventional?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/dart/naming_conventions/many_to_one_association_helpers.rb', line 15

def name_is_conventional?
  naming_conventions.plural_association_name(foreign_key) == associated_table
end