summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-23 11:26:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-23 11:26:04 +0000
commitd74f0bfd5c53962e332c2dd4d30dafaa1105b92b (patch)
treef3eaf66d67c3a87fb34340561bf188d364de623c /lib/plugins
parent41bb302594b48152b87c92f196c915f499093bbf (diff)
downloadredmine-d74f0bfd5c53962e332c2dd4d30dafaa1105b92b.tar.gz
redmine-d74f0bfd5c53962e332c2dd4d30dafaa1105b92b.zip
Merged rails-5.1 branch (#23630).
git-svn-id: http://svn.redmine.org/redmine/trunk@16859 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb6
-rw-r--r--lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb1
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
index 36996c950..3cfc49169 100644
--- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
+++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
@@ -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)
diff --git a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
index 2bddd64b7..5c88adb57 100644
--- a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
+++ b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
@@ -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