.freeze by integers makes no sense

This commit is contained in:
Karel Pičman 2018-06-18 13:58:59 +02:00
parent 0936a338d1
commit b945954eda
7 changed files with 22 additions and 22 deletions

View File

@ -45,8 +45,8 @@ class DmsfFile < ActiveRecord::Base
:class_name => 'DmsfLink', :foreign_key => 'target_id', :dependent => :destroy
has_many :dmsf_public_urls, :dependent => :destroy
STATUS_DELETED = 1.freeze
STATUS_ACTIVE = 0.freeze
STATUS_DELETED = 1
STATUS_ACTIVE = 0
scope :visible, -> { where(:deleted => STATUS_ACTIVE) }
scope :deleted, -> { where(:deleted => STATUS_DELETED) }

View File

@ -28,8 +28,8 @@ class DmsfFileRevisionAccess < ActiveRecord::Base
validates :dmsf_file_revision, :presence => true
DownloadAction = 0.freeze
EmailAction = 1.freeze
DownloadAction = 0
EmailAction = 1
acts_as_event :title => Proc.new {|ra| "#{l(:label_dmsf_downloaded)}: #{ra.dmsf_file.dmsf_path_str}"},
:url => Proc.new {|ra| {:controller => 'dmsf_files', :action => 'show', :id => ra.dmsf_file}},

View File

@ -44,8 +44,8 @@ class DmsfFolder < ActiveRecord::Base
has_many :dmsf_folder_permissions, :dependent => :destroy
INVALID_CHARACTERS = '\[\]\/\\\?":<>#%\*'.freeze
STATUS_DELETED = 1.freeze
STATUS_ACTIVE = 0.freeze
STATUS_DELETED = 1
STATUS_ACTIVE = 0
AVAILABLE_COLUMNS = %w(id title extension size modified version workflow author).freeze
DEFAULT_COLUMNS = %w(title size modified version workflow author).freeze

View File

@ -47,8 +47,8 @@ class DmsfLink < ActiveRecord::Base
end
end
STATUS_DELETED = 1.freeze
STATUS_ACTIVE = 0.freeze
STATUS_DELETED = 1
STATUS_ACTIVE = 0
scope :visible, -> { where(:deleted => STATUS_ACTIVE) }
scope :deleted, -> { where(:deleted => STATUS_DELETED) }

View File

@ -57,14 +57,14 @@ class DmsfWorkflow < ActiveRecord::Base
end
end
STATE_ASSIGNED = 3.freeze
STATE_WAITING_FOR_APPROVAL = 1.freeze
STATE_APPROVED = 2.freeze
STATE_REJECTED = 4.freeze
STATE_OBSOLETE = 5.freeze
STATE_ASSIGNED = 3
STATE_WAITING_FOR_APPROVAL = 1
STATE_APPROVED = 2
STATE_REJECTED = 4
STATE_OBSOLETE = 5
STATUS_LOCKED = 0.freeze
STATUS_ACTIVE = 1.freeze
STATUS_LOCKED = 0
STATUS_ACTIVE = 1
def participiants
users = Array.new

View File

@ -31,8 +31,8 @@ class DmsfWorkflowStep < ActiveRecord::Base
validates_uniqueness_of :user_id, :scope => [:dmsf_workflow_id, :step]
validates_length_of :name, :maximum => 30
OPERATOR_OR = 0.freeze
OPERATOR_AND = 1.freeze
OPERATOR_OR = 0
OPERATOR_AND = 1
def soperator
DmsfWorkflowStep.soperator(self.operator)

View File

@ -30,11 +30,11 @@ class DmsfWorkflowStepAction < ActiveRecord::Base
validates_uniqueness_of :dmsf_workflow_step_assignment_id, :scope => [:action],
:unless => lambda {self.action == DmsfWorkflowStepAction::ACTION_DELEGATE}
ACTION_APPROVE = 1.freeze
ACTION_REJECT = 2.freeze
ACTION_DELEGATE = 3.freeze
ACTION_ASSIGN = 4.freeze
ACTION_START = 5.freeze
ACTION_APPROVE = 1
ACTION_REJECT = 2
ACTION_DELEGATE = 3
ACTION_ASSIGN = 4
ACTION_START = 5
def initialize(*args)
super