mirror of
https://github.com/redmine/redmine.git
synced 2025-11-18 03:00:52 +01:00
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4481 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -50,6 +50,21 @@ module Redmine
|
||||
:order => 'position')
|
||||
end
|
||||
|
||||
# Sets the values of the object's custom fields
|
||||
# values is an array like [{'id' => 1, 'value' => 'foo'}, {'id' => 2, 'value' => 'bar'}]
|
||||
def custom_fields=(values)
|
||||
values_to_hash = values.inject({}) do |hash, v|
|
||||
v = v.stringify_keys
|
||||
if v['id'] && v.has_key?('value')
|
||||
hash[v['id']] = v['value']
|
||||
end
|
||||
hash
|
||||
end
|
||||
self.custom_field_values = values_to_hash
|
||||
end
|
||||
|
||||
# Sets the values of the object's custom fields
|
||||
# values is a hash like {'1' => 'foo', 2 => 'bar'}
|
||||
def custom_field_values=(values)
|
||||
@custom_field_values_changed = true
|
||||
values = values.stringify_keys
|
||||
|
||||
Reference in New Issue
Block a user