]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/changeset.rb
Add unsubscribe link to changeset notification mails
[rails.git] / app / models / changeset.rb
index 7f70f4a383185b91d237aabe2223a90791ad6883..abb494de64af3333a761431d2191d9b92afa9759 100644 (file)
@@ -213,4 +213,16 @@ class Changeset < ApplicationRecord
 
     save_with_tags!
   end
+
+  def subscribe(user)
+    subscribers << user
+  end
+
+  def unsubscribe(user)
+    subscribers.delete(user)
+  end
+
+  def subscribed?(user)
+    subscribers.exists?(user.id)
+  end
 end