Module: Formalism::ModelForms::Update

Includes:
Base
Defined in:
lib/formalism/model_forms/update.rb

Overview

Base form for model updating

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary

Attributes included from Base

#instance

Instance Method Summary collapse

Methods included from Base

#before_retry

Instance Method Details

#initialize(params, pf_or_instance) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/formalism/model_forms/update.rb', line 26

def initialize(params, pf_or_instance)
	if pf_or_instance.is_a?(model)
		self.instance = pf_or_instance
	else
		public_send "#{primary_field_name}=", pf_or_instance
	end

	super params || {}
end