Created
November 7, 2017 15:23
-
-
Save tvw/378aa052e73e1af8624c664f057ab5f4 to your computer and use it in GitHub Desktop.
AR Collection
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
class MyCollection < ApplicationRecord | |
end | |
class MyCollectionObject < ApplicationRecord | |
end | |
m = MyCollection.new | |
m.objects << ModelA.first | |
m.objects << ModelB.first | |
m.objects << ModelX.first | |
m.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment