]> source.dussan.org Git - redmine.git/commitdiff
shorten long line of app/models/mailer.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 11 Dec 2020 14:17:42 +0000 (14:17 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 11 Dec 2020 14:17:42 +0000 (14:17 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20623 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/mailer.rb

index a1db8da3fe535cd3d10b1bc4b174b27af21465eb..7b4ca059cad6b696c3b0d6eb029bb23d8ec93abe 100644 (file)
@@ -294,8 +294,11 @@ class Mailer < ActionMailer::Base
     @wiki_content_url = url_for(:controller => 'wiki', :action => 'show',
                                       :project_id => wiki_content.project,
                                       :id => wiki_content.page.title)
-    mail :to => user,
-      :subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :id => wiki_content.page.pretty_title)}"
+    mail(
+      :to => user,
+      :subject =>
+        "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :id => wiki_content.page.pretty_title)}"
+    )
   end
 
   # Notifies users about a new wiki content (wiki page added).
@@ -317,14 +320,19 @@ class Mailer < ActionMailer::Base
     message_id wiki_content
     @wiki_content = wiki_content
     @user = user
-    @wiki_content_url = url_for(:controller => 'wiki', :action => 'show',
-                                      :project_id => wiki_content.project,
-                                      :id => wiki_content.page.title)
-    @wiki_diff_url = url_for(:controller => 'wiki', :action => 'diff',
-                                   :project_id => wiki_content.project, :id => wiki_content.page.title,
-                                   :version => wiki_content.version)
-    mail :to => user,
-      :subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :id => wiki_content.page.pretty_title)}"
+    @wiki_content_url =
+      url_for(:controller => 'wiki', :action => 'show',
+              :project_id => wiki_content.project,
+              :id => wiki_content.page.title)
+    @wiki_diff_url =
+      url_for(:controller => 'wiki', :action => 'diff',
+              :project_id => wiki_content.project, :id => wiki_content.page.title,
+              :version => wiki_content.version)
+    mail(
+      :to => user,
+      :subject =>
+        "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :id => wiki_content.page.pretty_title)}"
+    )
   end
 
   # Notifies users about the update of the specified wiki content
@@ -589,10 +597,12 @@ class Mailer < ActionMailer::Base
 
     user_ids = options[:users]
 
-    scope = Issue.open.where("#{Issue.table_name}.assigned_to_id IS NOT NULL" +
-      " AND #{Project.table_name}.status = #{Project::STATUS_ACTIVE}" +
-      " AND #{Issue.table_name}.due_date <= ?", days.day.from_now.to_date
-    )
+    scope =
+      Issue.open.where(
+        "#{Issue.table_name}.assigned_to_id IS NOT NULL" \
+          " AND #{Project.table_name}.status = #{Project::STATUS_ACTIVE}" \
+          " AND #{Issue.table_name}.due_date <= ?", days.day.from_now.to_date
+      )
     scope = scope.where(:assigned_to_id => user_ids) if user_ids.present?
     scope = scope.where(:project_id => project.id) if project
     scope = scope.where(:fixed_version_id => target_version_id) if target_version_id.present?