[openstreetmap/openstreetmap-website] Diary entry comment subscriptions (#1309)

Tom Hughes notifications at github.com
Tue Oct 4 09:56:44 UTC 2016


tomhughes commented on this pull request.



> @@ -4,6 +4,7 @@ class User < ActiveRecord::Base
   has_many :traces, -> { where(:visible => true) }
   has_many :diary_entries, -> { order(:created_at => :desc) }
   has_many :diary_comments, -> { order(:created_at => :desc) }
+  has_and_belongs_to_many :diary_entries_subscriptions, :class_name => "DiaryEntry", :join_table => "diary_entries_subscribers", :foreign_key => "subscriber_id"

Canonical rails would be `user_id` and `diary_entry_id` for the columns in a relationship table like this I think?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1309
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20161004/f152c73f/attachment-0001.html>


More information about the rails-dev mailing list