mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user