Merged rails-5.1 branch (#23630).

git-svn-id: http://svn.redmine.org/redmine/trunk@16859 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2017-07-23 11:26:04 +00:00
parent 41bb302594
commit d74f0bfd5c
381 changed files with 598 additions and 640 deletions

View File

@@ -68,6 +68,10 @@ module Redmine
end
def save_attachments(attachments, author=User.current)
if attachments.respond_to?(:to_unsafe_hash)
attachments = attachments.to_unsafe_hash
end
if attachments.is_a?(Hash)
attachments = attachments.stringify_keys
attachments = attachments.to_a.sort {|a, b|
@@ -86,7 +90,7 @@ module Redmine
if attachments.is_a?(Array)
@failed_attachment_count = 0
attachments.each do |attachment|
next unless attachment.is_a?(Hash)
next unless attachment.present?
a = nil
if file = attachment['file']
a = Attachment.create(:file => file, :author => author)

View File

@@ -17,7 +17,6 @@ module Redmine
joins(:watchers).
where("#{Watcher.table_name}.user_id = ?", user_id)
}
attr_protected :watcher_ids, :watcher_user_ids
end
send :include, Redmine::Acts::Watchable::InstanceMethods
end