]> git.openstreetmap.org Git - rails.git/blob - lib/tasks/subscribe_diary_authors.rake
Merge pull request #5056 from AntonKhorev/diary-og-description
[rails.git] / lib / tasks / subscribe_diary_authors.rake
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