app/events/decidim/comments/comment_created_event.rb in decidim-comments-0.10.1 vs app/events/decidim/comments/comment_created_event.rb in decidim-comments-0.11.0.pre1
- old
+ new
@@ -5,14 +5,10 @@
class CommentCreatedEvent < Decidim::Events::SimpleEvent
include Decidim::Events::AuthorEvent
delegate :author, to: :comment
- def i18n_scope
- "decidim.events.comments.comment_created.#{comment_type}"
- end
-
def resource_path
resource_locator.path(url_params)
end
def resource_url
@@ -23,15 +19,11 @@
def comment
@comment ||= Decidim::Comments::Comment.find(extra[:comment_id])
end
- def comment_type
- comment.depth.zero? ? :comment : :reply
- end
-
def url_params
- comment_type == :comment ? {} : { anchor: "comment_#{comment.id}" }
+ { anchor: "comment_#{comment.id}" }
end
end
end
end