Project

General

Profile

Defect #9737 » save_custom_values_after_customized_is_saved.diff

Damián Farina, 2011-12-06 17:53

View differences:

vendor/plugins/acts_as_customizable/lib/acts_as_customizable.rb (working copy)
# redMine - project management software
# Copyright (C) 2006-2008 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
......
end
def custom_field_values
@custom_field_values ||= available_custom_fields.collect { |x| custom_values.detect { |v| v.custom_field == x } || custom_values.build(:custom_field => x, :value => nil) }
@custom_field_values ||= available_custom_fields.collect { |x| custom_values.detect { |v| v.custom_field == x } || custom_values.build(:customized => self, :custom_field => x, :value => nil) }
end
def visible_custom_field_values
......
custom_field_values.each(&:save)
@custom_field_values_changed = false
@custom_field_values = nil
self.custom_values = custom_field_values
end
def reset_custom_values!
    (1-1/1)