NameError: uninitialized constant #122

This commit is contained in:
Karel Pičman 2019-04-03 13:33:27 +02:00
parent bf014a4b23
commit 1ba81a33a2
2 changed files with 2 additions and 3 deletions

View File

@ -50,7 +50,7 @@ class CustomWorkflowsController < ApplicationController
end
def index
@workflows = CustomWorkflow.includes(:projects).all
@workflows = CustomWorkflow.includes(:projects).order(:position => :asc)
respond_to do |format|
format.html
end

View File

@ -33,8 +33,7 @@ class CustomWorkflow < ActiveRecord::Base
validates_uniqueness_of :name, :case_sensitive => false
validates_format_of :author, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :allow_blank => true
validate :validate_syntax, :validate_scripts_presence, :if => Proc.new {|workflow| workflow.respond_to?(:observable) and workflow.active?}
default_scope { order(:position => :asc) }
scope :active, lambda { where(:active => true) }
scope :for_project, (lambda do |project|
where("is_for_all=? OR EXISTS (SELECT * FROM #{reflect_on_association(:projects).join_table} WHERE project_id=? AND custom_workflow_id=id)",