Class: AASM::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/aasm/configuration.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Attribute Details

.hide_warningsObject

Returns the value of attribute hide_warnings.



45
46
47
# File 'lib/aasm/configuration.rb', line 45

def hide_warnings
  @hide_warnings
end

Instance Attribute Details

#columnObject

for all persistence layers: which database column to use?



4
5
6
# File 'lib/aasm/configuration.rb', line 4

def column
  @column
end

#create_scopesObject

for all persistence layers: create named scopes for each state



10
11
12
# File 'lib/aasm/configuration.rb', line 10

def create_scopes
  @create_scopes
end

#enumObject

Returns the value of attribute enum.



36
37
38
# File 'lib/aasm/configuration.rb', line 36

def enum
  @enum
end

#loggerObject

Configure a logger, with default being a Logger to STDERR



42
43
44
# File 'lib/aasm/configuration.rb', line 42

def logger
  @logger
end

#namespaceObject

namespace reader methods and constants



39
40
41
# File 'lib/aasm/configuration.rb', line 39

def namespace
  @namespace
end

#no_direct_assignmentObject

forbid direct assignment in aasm_state column (in ActiveRecord)



31
32
33
# File 'lib/aasm/configuration.rb', line 31

def no_direct_assignment
  @no_direct_assignment
end

#requires_lockObject

for ActiveRecord: use pessimistic locking



25
26
27
# File 'lib/aasm/configuration.rb', line 25

def requires_lock
  @requires_lock
end

#requires_new_transactionObject

for ActiveRecord: use requires_new for nested transactions?



22
23
24
# File 'lib/aasm/configuration.rb', line 22

def requires_new_transaction
  @requires_new_transaction
end

#skip_validation_on_saveObject

for ActiveRecord: store the new state even if the model is invalid and return true



16
17
18
# File 'lib/aasm/configuration.rb', line 16

def skip_validation_on_save
  @skip_validation_on_save
end

#timestampsObject

automatically set ‘“#state_name_at” = ::Time.now` on state changes



28
29
30
# File 'lib/aasm/configuration.rb', line 28

def timestamps
  @timestamps
end

#use_transactionsObject

for ActiveRecord: use transactions



19
20
21
# File 'lib/aasm/configuration.rb', line 19

def use_transactions
  @use_transactions
end

#whiny_persistenceObject

for ActiveRecord: when the model is invalid, true -> raise, false -> return false



13
14
15
# File 'lib/aasm/configuration.rb', line 13

def whiny_persistence
  @whiny_persistence
end

#whiny_transitionsObject

let’s cry if the transition is invalid



7
8
9
# File 'lib/aasm/configuration.rb', line 7

def whiny_transitions
  @whiny_transitions
end

#with_klassObject

allow a AASM::Base sub-class to be used for state machine



34
35
36
# File 'lib/aasm/configuration.rb', line 34

def with_klass
  @with_klass
end