Module: ActiveSchema::Associations::Naming

Included in:
ByForeignKey
Defined in:
lib/active_schema/associations/by_foreign_key.rb

Instance Method Summary collapse

Instance Method Details

#name_for(model) ⇒ Object



3
4
5
# File 'lib/active_schema/associations/by_foreign_key.rb', line 3

def name_for(model)
  model.name.demodulize.underscore.downcase
end

#plural_name_for(model) ⇒ Object



7
8
9
# File 'lib/active_schema/associations/by_foreign_key.rb', line 7

def plural_name_for(model)
  name_for(model).pluralize
end