fix rubocop warnings
[rails.git] / db / migrate / 20161002153425_add_join_table_between_users_and_diary_entries.rb
index b99dbbdb8c1c2c64b3a82f7e709e79b3fd55f11f..ad642f96cac977e829b9203009e4f702f1d52147 100644 (file)
@@ -11,7 +11,7 @@ class AddJoinTableBetweenUsersAndDiaryEntries < ActiveRecord::Migration
 
   def up
     DiaryEntry.find_each do |diary_entry|
-      diary_entry.subscriptions.create(user: diary_entry.user) unless diary_entry.subscribers.exists?(@user)
+      diary_entry.subscriptions.create(:user => diary_entry.user) unless diary_entry.subscribers.exists?(@user.id)
     end
   end