]> git.openstreetmap.org Git - rails.git/commitdiff
Add explicit primary key declaration for changeset subscriptions
authorTom Hughes <tom@compton.nu>
Tue, 6 Jun 2017 19:33:09 +0000 (20:33 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 6 Jun 2017 21:42:25 +0000 (22:42 +0100)
This table has a composite primary key and although we don't really
rely on that at all rails 5.0 warns about itif you don't explcitly
declare it in order to trigger the CPK extension.

app/models/diary_entry_subscription.rb

index b0a563ea866dcd74b0ee583da874d423216dff0c..8b96f60743fbedd5ca1b4acda887d248c0dce86e 100644 (file)
@@ -1,4 +1,6 @@
 class DiaryEntrySubscription < ActiveRecord::Base
 class DiaryEntrySubscription < ActiveRecord::Base
+  self.primary_keys = "user_id", "diary_entry_id"
+
   belongs_to :user
   belongs_to :diary_entry
 end
   belongs_to :user
   belongs_to :diary_entry
 end