Module: Formalism::SequelTransactions

Defined in:
lib/formalism/sequel_transactions.rb,
lib/formalism/sequel_transactions/version.rb

Overview

Main module which should be included into base form

Constant Summary collapse

VERSION =
'0.4.0'

Instance Method Summary collapse

Instance Method Details

#before_retryObject



24
25
26
27
28
29
30
# File 'lib/formalism/sequel_transactions.rb', line 24

def before_retry
	nested_forms.each_value(&__method__)

	@filled_fields_and_nested_forms.clear

	fill_fields_and_nested_forms
end

#initializeObject



10
11
12
13
14
# File 'lib/formalism/sequel_transactions.rb', line 10

def initialize(*)
	@ran_times = 0

	super
end

#runObject



16
17
18
19
20
21
22
# File 'lib/formalism/sequel_transactions.rb', line 16

def run
	return unless runnable

	result = db_connection.in_transaction? ? run_without_transaction.last : run_with_transaction

	Form::Outcome.new(errors, result)
end