Module: Formalism::ModelForms::FindOrCreate

Extended by:
ModuleMethods::Extension
Defined in:
lib/formalism/model_forms/find_or_create.rb

Overview

Base form for model finding

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#initialize(params_or_instance = {}) ⇒ Object



34
35
36
37
38
# File 'lib/formalism/model_forms/find_or_create.rb', line 34

def initialize(params_or_instance = {})
	@params_or_instance = params_or_instance

	super
end

#instanceObject



40
41
42
# File 'lib/formalism/model_forms/find_or_create.rb', line 40

def instance
	find_form.instance || create_form.instance
end