1 class SubscribeAuthorsToDiaryEntries < ActiveRecord::Migration[4.2]
2 class DiaryEntry < ActiveRecord::Base
6 DiaryEntry.find_each do |diary_entry|
7 diary_entry.subscriptions.create(:user => diary_entry.user) unless diary_entry.subscribers.exists?(diary_entry.user.id)