summaryrefslogtreecommitdiffstats
path: root/lib/redmine/safe_attributes.rb
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/redmine/safe_attributes.rb
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/redmine/safe_attributes.rb')
-rw-r--r--lib/redmine/safe_attributes.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/redmine/safe_attributes.rb b/lib/redmine/safe_attributes.rb
index 0bde0f970..a2711cc4b 100644
--- a/lib/redmine/safe_attributes.rb
+++ b/lib/redmine/safe_attributes.rb
@@ -80,6 +80,10 @@ module Redmine
# Sets attributes from attrs that are safe
# attrs is a Hash with string keys
def safe_attributes=(attrs, user=User.current)
+ if attrs.respond_to?(:to_unsafe_hash)
+ attrs = attrs.to_unsafe_hash
+ end
+
return unless attrs.is_a?(Hash)
self.attributes = delete_unsafe_attributes(attrs, user)
end