From 7097fcedecb681209364f73406181fb2c2925013 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 11 Dec 2020 14:17:42 +0000 Subject: [PATCH] shorten long line of app/models/mailer.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20623 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mailer.rb | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index a1db8da3f..7b4ca059c 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -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? -- 2.39.5