-
Notifications
You must be signed in to change notification settings - Fork 899
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added has_and_belongs_to_many reification
HABTM associations are saved in the version_assocations table with the foreign_key_name set to the association name. They are saved if either the associated model is being paper trailed, or if the option join_tables: [:association_name] is passed to the has_paper_trail declaration. If the option is passed but the associated model is not paper trailed, only the join model will be saved. This means reification of HABTM would reify the associated objects but in their current state. If the associated model is paper trailed, this option does nothing, and the version of the model at the time is reified.
- Loading branch information
Sam Boylett
committed
Apr 15, 2016
1 parent
7733894
commit c010ad9
Showing
7 changed files
with
231 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class BarHabtm < ActiveRecord::Base | ||
has_and_belongs_to_many :foo_habtms | ||
has_paper_trail | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class FooHabtm < ActiveRecord::Base | ||
has_and_belongs_to_many :bar_habtms | ||
has_paper_trail | ||
end |
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