summaryrefslogtreecommitdiffstats
path: root/app/models/mailer.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-11 14:17:42 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-11 14:17:42 +0000
commit7097fcedecb681209364f73406181fb2c2925013 (patch)
tree140985ef53d8801d6cfc68833c1f5b970ae0c528 /app/models/mailer.rb
parent252a605a6d99acff575f63c18ccedccf79e312cf (diff)
downloadredmine-7097fcedecb681209364f73406181fb2c2925013.tar.gz
redmine-7097fcedecb681209364f73406181fb2c2925013.zip
shorten long line of app/models/mailer.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20623 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/mailer.rb')
-rw-r--r--app/models/mailer.rb38
1 files 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?