Бесплатная консультация

8 (800) 250-41-43

sales@zig-zag.org

8 (800) 250-41-43

sales@zig-zag.org

Регистрация

menu

Отраслевые комплексные решения

another

Hello description

Решения:

sol2

A Guide to Active Record Associations

This guide covers the association features of Active Record. By referring to this guide, you will be able to:

  • Declare associations between Active Record models
  • Understand the various types of Active Record associations
  • Use the methods added to your models by creating associations

Chapters

  1. Why Associations?
  2. The Types of Associations
  3. Tips, Tricks, and Warnings
  4. Detailed Association Reference

1 Why Associations?

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: