shorten long line of app/models/mailer.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@20623 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2020-12-11 14:17:42 +00:00
parent 252a605a6d
commit 7097fcedec

View 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?