-
-
Notifications
You must be signed in to change notification settings - Fork 936
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Associations should be defined before of being used in
:through
In Active Record 5.1+ isn't possible to use an association in `:through` option before of defining it, e.g: ``` has_many :rubygems, through: :ownerships has_many :ownerships, dependent: :destroy ``` will raise an error because the `ownerships` association is being used in the first association before of being defined, to fix it the order of the associations needs to be changed: ``` has_many :ownerships, dependent: :destroy has_many :rubygems, through: :ownerships ```
- Loading branch information
1 parent
88ced40
commit 4f87c66
Showing
2 changed files
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters