lib/bureaucrat/forms.rb
# List names for fields that have changed data
List names for fields that have changed data
List names for fields that have changed data
def changed_data
        if @changed_data.nil?
          @changed_data = []
          @fields.each do |name, field|
            prefixed_name = add_prefix(name)
            data_value = field.widget.
              value_from_formdata(@data, prefixed_name)
            if !field.show_hidden_initial
              initial_value = @initial.fetch(name, field.initial)
            else
              initial_prefixed_name = add_initial_prefix(name)
              hidden_widget = field.hidden_widget.new
              initial_value = hidden_widget.
                value_from_formdata(@data, initial_prefixed_name)
            end
            @changed_data << name if
              field.widget.has_changed?(initial_value, data_value)
          end
        end
        @changed_data
      end
def changed_data if @changed_data . nil? @changed_data = [ ] @fields . each do | name , field | prefixed_name = add_prefix ( name ) data_value = field . widget . value_from_formdata ( @data , prefixed_name ) if ! field . show_hidden_initial initial_value = @initial . fetch ( name , field . initial ) else initial_prefixed_name = add_initial_prefix ( name ) hidden_widget = field . hidden_widget . new initial_value = hidden_widget . value_from_formdata ( @data , initial_prefixed_name ) end @changed_data << name if field . widget . has_changed? ( initial_value , data_value ) end end @changed_data end
List names for fields that have changed data
List names for fields that have changed data