1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

ApplicationRecord instead of ActiveRecord::Base in Association Guides [ci skip]

This commit is contained in:
amitkumarsuroliya 2016-01-19 11:09:34 +05:30
parent be3d4c6ef6
commit b4803e6ea7

View file

@ -19,10 +19,10 @@ Why Associations?
In Rails, an _association_ is a connection between two Active Record models. Why do we need associations between models? Because they make common operations simpler and easier in your code. For example, consider a simple Rails application that includes a model for customers and a model for orders. Each customer can have many orders. Without associations, the model declarations would look like this:
```ruby
class Author < ActiveRecord::Base
class Author < ApplicationRecord
end
class Book < ActiveRecord::Base
class Book < ApplicationRecord
end
```