Sha256: 3efcc7c7760144cc54c31177cced1c92f8ab1bf604868827176b13204a5c4e2c

Contents?: true

Size: 940 Bytes

Versions: 9

Compression:

Stored size: 940 Bytes

Contents

# frozen_string_literal: true

module RailsWorkflow
  module Db
    module Mysql
      COUNT_STATUSES = <<-SQL
      SELECT status, cnt FROM
               (
                    SELECT @row_number:=CASE
                                            WHEN @status=status THEN @row_number+1
                                            ELSE 1
                                        END AS row_number,
                           cnt,
                           @status:=status as status
                    FROM
                      ( SELECT count(*) AS cnt,
                               a.status
                        FROM rails_workflow_processes a
                        LEFT JOIN rails_workflow_processes b ON a.status=b.status
                        GROUP BY a.status,a.id
                      ) tmp,
                      (SELECT @row_number:=0,@status:=-1) AS t
               ) t1 WHERE row_number = 1
      SQL
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_workflow-0.7.3 lib/rails_workflow/db/mysql.rb
rails_workflow-0.7.2 lib/rails_workflow/db/mysql.rb
rails_workflow-0.7.1 lib/rails_workflow/db/mysql.rb
rails_workflow-0.7.0 lib/rails_workflow/db/mysql.rb
rails_workflow-0.4.4 lib/rails_workflow/db/mysql.rb
rails_workflow-0.4.3 lib/rails_workflow/db/mysql.rb
rails_workflow-0.4.2 lib/rails_workflow/db/mysql.rb
rails_workflow-0.4.1 lib/rails_workflow/db/mysql.rb
rails_workflow-0.4.0 lib/rails_workflow/db/mysql.rb