From 34f68d1718f8acf4750feb56965670183aaf4a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Fri, 27 Mar 2015 09:34:04 +0100 Subject: [PATCH] Cannot create a document workflow #368 --- app/models/dmsf_file.rb | 3 +++ app/models/dmsf_file_revision.rb | 5 ++++- app/models/dmsf_workflow_step_assignment.rb | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index 062254b2..6d061188 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 +# # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš @@ -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' diff --git a/app/models/dmsf_file_revision.rb b/app/models/dmsf_file_revision.rb index cfff5f74..272fb67d 100644 --- a/app/models/dmsf_file_revision.rb +++ b/app/models/dmsf_file_revision.rb @@ -1,7 +1,9 @@ +# encoding: utf-8 +# # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # 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) diff --git a/app/models/dmsf_workflow_step_assignment.rb b/app/models/dmsf_workflow_step_assignment.rb index b1e88a29..cda7d8f3 100644 --- a/app/models/dmsf_workflow_step_assignment.rb +++ b/app/models/dmsf_workflow_step_assignment.rb @@ -1,6 +1,8 @@ +# encoding: utf-8 +# # Redmine plugin for Document Management System "Features" # -# Copyright (C) 2013 Karel Picman +# Copyright (C) 2011-15 Karel Pičman # # 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