Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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