Module: Eventful::ActiveRecord::ClassMethods
- Defined in:
- lib/Eventful/ActiveRecord/ClassMethods.rb
Instance Method Summary collapse
Instance Method Details
#active ⇒ Object
8 9 10 11 12 |
# File 'lib/Eventful/ActiveRecord/ClassMethods.rb', line 8 def active final_state_names = stateful_state_machine.final_states.collect(&:name).collect(&:to_s) final_state_names_with_empty = (final_state_names.empty? ? '' : final_state_names) where('current_state NOT IN (?)', final_state_names_with_empty).all end |