Class: Corzinus::AddressForm

Inherits:
Rectify::Form
  • Object
show all
Includes:
BaseValidators
Defined in:
app/forms/corzinus/address_form.rb

Constant Summary collapse

STRING_ATTRS =
[:first_name, :last_name, :name, :zip, :phone, :city].freeze
INTEGER_ATTRS =
[:country_id, :address_type].freeze

Instance Method Summary collapse

Instance Method Details

#merge_info(object) ⇒ Object



27
28
29
30
31
32
33
# File 'app/forms/corzinus/address_form.rb', line 27

def merge_info(object)
  STRING_ATTRS.each do |attribute|
    next if !object.respond_to?(attribute) || send(attribute).present?
    send("#{attribute}=", object.send(attribute))
  end
  self
end