Add direct linking to comments

This commit is contained in:
Kevin McConnell
2025-01-10 10:23:40 +00:00
parent af5ac65116
commit 8a51597408
4 changed files with 13 additions and 4 deletions
+1 -3
View File
@@ -1,11 +1,9 @@
class Bubble < ApplicationRecord
include Assignable, Boostable, Colored, Commentable, Eventable, Messages, Poppable, Searchable, Staged, Taggable
include Assignable, Boostable, Colored, Commentable, Eventable, Messages, Notifiable, Poppable, Searchable, Staged, Taggable
belongs_to :bucket, touch: true
belongs_to :creator, class_name: "User", default: -> { Current.user }
has_many :notifications, as: :resource, dependent: :destroy
has_one_attached :image, dependent: :purge_later
before_save :set_default_title
+1 -1
View File
@@ -1,5 +1,5 @@
class Comment < ApplicationRecord
include Searchable, Messageable
include Messageable, Notifiable, Searchable
belongs_to :creator, class_name: "User", default: -> { Current.user }
+7
View File
@@ -0,0 +1,7 @@
module Notifiable
extend ActiveSupport::Concern
included do
has_many :notifications, as: :resource, dependent: :destroy
end
end
+4
View File
@@ -12,6 +12,10 @@ Rails.application.routes.draw do
route_for :bucket_bubble, bubble.bucket, bubble, options
end
resolve "Comment" do |comment, options|
route_for :bucket_bubble, comment.bubble.bucket, comment.bubble, anchor: ActionView::RecordIdentifier.dom_id(comment)
end
resources :bubbles
resources :notifications