undefined method 'name' for #<Array>
This commit is contained in:
parent
c142af56ab
commit
e40966955f
@ -663,7 +663,7 @@ class DmsfController < ApplicationController
|
|||||||
recipients = DmsfMailer.deliver_files_deleted(@project, deleted_files)
|
recipients = DmsfMailer.deliver_files_deleted(@project, deleted_files)
|
||||||
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
|
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
|
||||||
if recipients.any?
|
if recipients.any?
|
||||||
to = recipients.collect{ |r| r.name }.first(Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i).join(', ')
|
to = recipients.collect{ |user, _| user.name }.first(Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i).join(', ')
|
||||||
to << ((recipients.count > Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i) ? ',...' : '.')
|
to << ((recipients.count > Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i) ? ',...' : '.')
|
||||||
flash[:warning] = l(:warning_email_notifications, to: to)
|
flash[:warning] = l(:warning_email_notifications, to: to)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -184,8 +184,10 @@ class DmsfFilesController < ApplicationController
|
|||||||
recipients = DmsfMailer.deliver_files_updated(@project, [@file])
|
recipients = DmsfMailer.deliver_files_updated(@project, [@file])
|
||||||
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
|
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
|
||||||
if recipients.any?
|
if recipients.any?
|
||||||
to = recipients.collect{ |r| r.name }.first(Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i).join(', ')
|
to = recipients.collect{ |user, _| user.name }.first(
|
||||||
to << ((recipients.count > Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i) ? ',...' : '.')
|
Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i).join(', ')
|
||||||
|
to << ((recipients.count > Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i) ?
|
||||||
|
',...' : '.')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
@ -229,8 +231,10 @@ class DmsfFilesController < ApplicationController
|
|||||||
recipients = DmsfMailer.deliver_files_deleted(@project, [@file])
|
recipients = DmsfMailer.deliver_files_deleted(@project, [@file])
|
||||||
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
|
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
|
||||||
if recipients.any?
|
if recipients.any?
|
||||||
to = recipients.collect{ |r| r.name }.first(Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i).join(', ')
|
to = recipients.collect{ |user, _| user.name }.first(
|
||||||
to << ((recipients.count > Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i) ? ',...' : '.')
|
Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i).join(', ')
|
||||||
|
to << ((recipients.count > Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i) ?
|
||||||
|
',...' : '.')
|
||||||
flash[:warning] = l(:warning_email_notifications, to: to)
|
flash[:warning] = l(:warning_email_notifications, to: to)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -133,8 +133,10 @@ module DmsfUploadHelper
|
|||||||
recipients = DmsfMailer.deliver_files_updated(project, files)
|
recipients = DmsfMailer.deliver_files_updated(project, files)
|
||||||
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
|
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
|
||||||
unless recipients.empty?
|
unless recipients.empty?
|
||||||
to = recipients.collect{ |r| r.name }.first(Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i).join(', ')
|
to = recipients.collect{ |user, _| user.name }.first(
|
||||||
to << ((recipients.count > Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i) ? ',...' : '.')
|
Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i).join(', ')
|
||||||
|
to << ((recipients.count > Setting.plugin_redmine_dmsf['dmsf_max_notification_receivers_info'].to_i) ?
|
||||||
|
',...' : '.')
|
||||||
controller.flash[:warning] = l(:warning_email_notifications, to: to) if controller
|
controller.flash[:warning] = l(:warning_email_notifications, to: to) if controller
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user