Soner Mezgitci
5 min readNov 19, 2019

--

1 What is Active Record?

belongs_to associations must use the singular term. If you used the pluralized form in the above example for the author assoc belongs_to associations must use the singular term. If you used the pluralized form in the above example for the author association in the Book model and tried to create the instance by Book.create(authors: @author), you would be told that there was an "uninitialized constant Book::Authors". This is because Rails automatically infers the class name from the association name. If the association name is wrongly pluralized, then the inferred class will be wrongly pluralized too.

Validations

Callbacks

Migrations

--

--

Soner Mezgitci

Software Engineer | Ruby on Rails | JavaScript | HTML5 | CSS | PostgreSQL | React | Redux