Add direct linking to comments
This commit is contained in:
@@ -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,5 +1,5 @@
|
||||
class Comment < ApplicationRecord
|
||||
include Searchable, Messageable
|
||||
include Messageable, Notifiable, Searchable
|
||||
|
||||
belongs_to :creator, class_name: "User", default: -> { Current.user }
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
module Notifiable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
has_many :notifications, as: :resource, dependent: :destroy
|
||||
end
|
||||
end
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user