Class: Basepack::Forms::Groups::Diff

Inherits:
Base
  • Object
show all
Defined in:
lib/basepack/forms/groups/diff.rb

Instance Attribute Summary

Attributes inherited from Base

#delegate, #field_names, #form

Instance Method Summary collapse

Methods inherited from Base

#content_for_field, #field, #fields, #initialize, #remove, #update_attributes, #values, #values_without_blank, #visible_fields

Constructor Details

This class inherits a constructor from Basepack::Forms::Groups::Base

Instance Method Details

#changesObject



9
10
11
12
13
14
# File 'lib/basepack/forms/groups/diff.rb', line 9

def changes
  fields2_hash = form.form2.fields_hash
  visible_fields.map {|f| [f, fields2_hash[f.name]]}.reject do |f1, f2|
    (form.compare(f1.name) || form.compare("*")).call(f1, f2)
  end
end

#visible_fields2Object



5
6
7
# File 'lib/basepack/forms/groups/diff.rb', line 5

def visible_fields2
  field_names.map {|f| form.visible_field2(f)}.compact
end