Cannot create a document workflow #368

This commit is contained in:
Karel Pičman 2015-03-27 09:34:04 +01:00
parent 7158dcaba0
commit 34f68d1718
3 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
@ -31,6 +33,7 @@ class DmsfFile < ActiveRecord::Base
include RedmineDmsf::Lockable
attr_accessor :event_description
attr_accessible :project
belongs_to :project
belongs_to :folder, :class_name => 'DmsfFolder', :foreign_key => 'dmsf_folder_id'

View File

@ -1,7 +1,9 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2011-14 Karel Pičman <karel.picman@kontron.com>
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -30,6 +32,7 @@ class DmsfFileRevision < ActiveRecord::Base
accepts_nested_attributes_for :access, :dmsf_workflow_step_assignment, :file, :user
end
attr_accessible :file
# Returns a list of revisions that are not deleted here, or deleted at parent level either
if (Rails::VERSION::MAJOR > 3)

View File

@ -1,6 +1,8 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2013 Karel Picman <karel.picman@kontron.com>
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,6 +26,8 @@ class DmsfWorkflowStepAssignment < ActiveRecord::Base
validates :dmsf_workflow_step_id, :dmsf_file_revision_id, :presence => true
validates_uniqueness_of :dmsf_workflow_step_id, :scope => [:dmsf_file_revision_id]
attr_accessible :dmsf_workflow_step_id, :user_id, :dmsf_file_revision_id
def add?(dmsf_file_revision_id)
if self.dmsf_file_revision_id == dmsf_file_revision_id
add = true