]> git.openstreetmap.org Git - rails.git/blob - lib/tasks/subscribe_diary_authors.rb
Merge remote-tracking branch 'upstream/pull/2639'
[rails.git] / lib / tasks / subscribe_diary_authors.rb
1 namespace :db do
2   task :subscribe_diary_authors => :environment do
3     DiaryEntry.find_each do |diary_entry|
4       diary_entry.subscriptions.create(:user => diary_entry.user) unless diary_entry.subscribers.exists?(diary_entry.user.id)
5     end
6   end
7 end