From 7ce466a92327c45dfa8a61dfe75ebfbb731d0b2a Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 25 Feb 2015 18:34:10 -0300 Subject: [PATCH] Rename Comment::Notifier to CommentNotifier --- app/mailers/comment_notifier.rb | 2 +- app/models/comment.rb | 4 ++-- app/views/comment/notifier/mail_to_followers.html.erb | 22 ---------------------- app/views/comment/notifier/notification.text.erb | 19 ------------------- app/views/comment_notifier/mail_to_followers.html.erb | 22 ++++++++++++++++++++++ app/views/comment_notifier/notification.text.erb | 19 +++++++++++++++++++ 6 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 app/views/comment/notifier/mail_to_followers.html.erb delete mode 100644 app/views/comment/notifier/notification.text.erb create mode 100644 app/views/comment_notifier/mail_to_followers.html.erb create mode 100644 app/views/comment_notifier/notification.text.erb diff --git a/app/mailers/comment_notifier.rb b/app/mailers/comment_notifier.rb index 9861301..faaf57c 100644 --- a/app/mailers/comment_notifier.rb +++ b/app/mailers/comment_notifier.rb @@ -1,4 +1,4 @@ -class Comment::Notifier < ActionMailer::Base +class CommentNotifier < ActionMailer::Base def notification(comment) profile = comment.article.profile @recipient = profile.nickname || profile.name diff --git a/app/models/comment.rb b/app/models/comment.rb index 2056ce9..51c7102 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -132,11 +132,11 @@ class Comment < ActiveRecord::Base def notify_by_mail if source.kind_of?(Article) && article.notify_comments? if !notification_emails.empty? - Comment::Notifier.notification(self).deliver + CommentNotifier.notification(self).deliver end emails = article.followers - [author_email] if !emails.empty? - Comment::Notifier.mail_to_followers(self, emails).deliver + CommentNotifier.mail_to_followers(self, emails).deliver end end end diff --git a/app/views/comment/notifier/mail_to_followers.html.erb b/app/views/comment/notifier/mail_to_followers.html.erb deleted file mode 100644 index 10d28d7..0000000 --- a/app/views/comment/notifier/mail_to_followers.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<%= _('Hi!') %> - -<%= word_wrap(_('%{sender} (%{sender_link}) commented on the content "%{article_title}".') % { :sender => @sender, :sender_link => url_for(@sender_link), :article_title => @article_title }) %> - -<%= word_wrap(_('Title: %s') % @comment_title) if @comment_title %> - -<%= _("Comment:") %> -------------------------------------------------------------------------------- -<%= word_wrap(@comment_body) %> -------------------------------------------------------------------------------- - -<%= _('Click on the address below to view this comment:') %> -<%= url_for @comment_url %> - -<%= _('Click on the address below to cancel the notification of new comments:') %> -<%= url_for @unsubscribe_url %> - -<%= _("Greetings,") %> - --- -<%= _('%s team.') % @environment %> -<%= url_for @url %> diff --git a/app/views/comment/notifier/notification.text.erb b/app/views/comment/notifier/notification.text.erb deleted file mode 100644 index 5fd6d71..0000000 --- a/app/views/comment/notifier/notification.text.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= _('Hi, %{recipient}!') % { :recipient => @recipient } %> - -<%= word_wrap(_('%{sender} (%{sender_link}) created a new comment on your article "%{article_title}".') % { :sender => @sender, :sender_link => url_for(@sender_link), :article_title => @article_title }) %> - -<%= word_wrap(_('Title: %s') % @comment_title) %> - -<%= _("Comment:") %> -------------------------------------------------------------------------------- -<%= word_wrap(@comment_body) %> -------------------------------------------------------------------------------- - -<%= _('Access the address below to view this comment:') %> -<%= url_for @comment_url %> - -<%= _("Greetings,") %> - --- -<%= _('%s team.') % @environment %> -<%= url_for @url %> diff --git a/app/views/comment_notifier/mail_to_followers.html.erb b/app/views/comment_notifier/mail_to_followers.html.erb new file mode 100644 index 0000000..10d28d7 --- /dev/null +++ b/app/views/comment_notifier/mail_to_followers.html.erb @@ -0,0 +1,22 @@ +<%= _('Hi!') %> + +<%= word_wrap(_('%{sender} (%{sender_link}) commented on the content "%{article_title}".') % { :sender => @sender, :sender_link => url_for(@sender_link), :article_title => @article_title }) %> + +<%= word_wrap(_('Title: %s') % @comment_title) if @comment_title %> + +<%= _("Comment:") %> +------------------------------------------------------------------------------- +<%= word_wrap(@comment_body) %> +------------------------------------------------------------------------------- + +<%= _('Click on the address below to view this comment:') %> +<%= url_for @comment_url %> + +<%= _('Click on the address below to cancel the notification of new comments:') %> +<%= url_for @unsubscribe_url %> + +<%= _("Greetings,") %> + +-- +<%= _('%s team.') % @environment %> +<%= url_for @url %> diff --git a/app/views/comment_notifier/notification.text.erb b/app/views/comment_notifier/notification.text.erb new file mode 100644 index 0000000..5fd6d71 --- /dev/null +++ b/app/views/comment_notifier/notification.text.erb @@ -0,0 +1,19 @@ +<%= _('Hi, %{recipient}!') % { :recipient => @recipient } %> + +<%= word_wrap(_('%{sender} (%{sender_link}) created a new comment on your article "%{article_title}".') % { :sender => @sender, :sender_link => url_for(@sender_link), :article_title => @article_title }) %> + +<%= word_wrap(_('Title: %s') % @comment_title) %> + +<%= _("Comment:") %> +------------------------------------------------------------------------------- +<%= word_wrap(@comment_body) %> +------------------------------------------------------------------------------- + +<%= _('Access the address below to view this comment:') %> +<%= url_for @comment_url %> + +<%= _("Greetings,") %> + +-- +<%= _('%s team.') % @environment %> +<%= url_for @url %> -- libgit2 0.21.2