Remove duplication rendering comments
We were using the same code 5 times, with the only slight variation being the extra heading in the debates section.
This commit is contained in:
9
app/components/shared/comments_component.rb
Normal file
9
app/components/shared/comments_component.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class Shared::CommentsComponent < ApplicationComponent
|
||||
attr_reader :record, :comment_tree
|
||||
delegate :current_user, :current_order, :locale_and_user_status, :commentable_cache_key, to: :helpers
|
||||
|
||||
def initialize(record, comment_tree)
|
||||
@record = record
|
||||
@comment_tree = comment_tree
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user