Skip to content

Instantly share code, notes, and snippets.

@tvw
Created November 7, 2017 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvw/378aa052e73e1af8624c664f057ab5f4 to your computer and use it in GitHub Desktop.
Save tvw/378aa052e73e1af8624c664f057ab5f4 to your computer and use it in GitHub Desktop.
AR Collection
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