I am using MongoID with rails 3.1. and I would like to sow my database (both in dev and in production). I have a Pages model with feeds enabled. What is the best way for me to plant embedded channels for each page? I can easily sow all the data on the page, not the built-in feeds. Please note that I am looking for actual unique data for these pages / channels, not just arbitrary test data. thanks!
page.rb (model)
... embeds_many :feeds
feed.rb (model)
class Feed include Mongoid::Document field :source, :type => String field :user, :type => String
embedded_in: page ,: inverse_of =>: channels end
db / seeds.rb
Page.create(title: "Page 1", userID: " EMAIL@gmail.com ", presentation: 'cards', customURL: 'testing1') Page.create(title: "Page 2", userID: " EMAIL@gmail.com ", presentation: 'cards', customURL: 'testing2') Page.create(title: "Page 3", userID: " EMAIL@gmail.com ", presentation: 'cards', customURL: 'testing3') Page.create(title: "Page 4", userID: " EMAIL@gmail.com ", presentation: 'cards', customURL: 'testing4') Page.create(title: "Page 5", userID: " EMAIL@gmail.com ", presentation: 'cards', customURL: 'testing5')
What's the best way to embed some feed data on each page? Thank you very much.
source share