Class: RailsWorkflow::Process
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RailsWorkflow::Process
- Includes:
- RailsWorkflow::Processes::DefaultRunner, RailsWorkflow::Processes::DependencyResolver, Status
- Defined in:
- app/models/rails_workflow/process.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.count_by_statuses ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'app/models/rails_workflow/process.rb', line 20 def self.count_by_statuses query = RailsWorkflow.config.sql_dialect::COUNT_STATUSES statuses = connection.select_all(query).rows (RailsWorkflow::Process::NOT_STARTED..RailsWorkflow::Process::ROLLBACK).to_a.map{|status| statuses.detect{|s| s.first.to_i == status }.try(:last).to_i } end |
Instance Method Details
#manager ⇒ Object
16 17 18 |
# File 'app/models/rails_workflow/process.rb', line 16 def manager @manager ||= template.manager_class.new(self) end |