Lesson Weekend

Here are the standard naming conventions for Active Record. Please note the English pluralization of words like person to people. Active Record actually knows that English doesn't always add an s to pluralize nouns and takes that into consideration.

Class Name
* Always singular
* UpperCamelCase

Examples
-------------
Task
Person
CreditCard
Table Name
* plural
* lower_snake_case

Examples
-------------
tasks
people
credit_cards
In belongs_to
* singular
* lower_snake_case

Examples
-------------
belongs_to(:task)
belongs_to(:person)
belongs_to(:credit_card)
In has_many
* plural
* lower_snake_case

Examples
-------------
has_many(:tasks)
has_many(:people)
has_many(:credit_cards)
In has_and_belongs_to_many
* plural
* lower_snake_case

Examples
-------------
has_and_belongs_to_many(:tasks)
has_and_belongs_to_many(:people)
has_and_belongs_to_many(:credit_cards)

Lesson 13 of 34
Last updated July 14, 2022