Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Volkmar Worm tvw

  • Hamburg, Germany
View GitHub Profile
View ar_collection.rb
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