Description length limit
This commit is contained in:
parent
d3cd1435cf
commit
a8eb0f8cc1
@ -72,6 +72,7 @@ class DmsfFolder < ActiveRecord::Base
|
||||
validates_format_of :title, :with => INVALID_CHARACTERS,
|
||||
:message => l(:error_contains_invalid_character)
|
||||
validate :check_cycle
|
||||
validates_length_of :description, :maximum => 65535
|
||||
|
||||
before_create :default_values
|
||||
def default_values
|
||||
|
||||
31
db/migrate/20170323131231_dmsf_description_limit.rb
Normal file
31
db/migrate/20170323131231_dmsf_description_limit.rb
Normal file
@ -0,0 +1,31 @@
|
||||
# encoding: utf-8
|
||||
#
|
||||
# Redmine plugin for Document Management System "Features"
|
||||
#
|
||||
# Copyright (C) 2011-17 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
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class DmsfDescriptionLimit < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :projects, :dmsf_description, :text, :null => true, :limit => 65535
|
||||
change_column :dmsf_folders, :description, :text,:null => true, :limit => 65535
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :projects, :dmsf_description, :text
|
||||
change_column :dmsf_folders, :description, :text
|
||||
end
|
||||
end
|
||||
@ -46,6 +46,8 @@ module RedmineDmsf
|
||||
:class_name => 'DmsfLink', :foreign_key => 'project_id', :dependent => :destroy
|
||||
|
||||
before_save :set_default_dmsf_notification
|
||||
|
||||
validates_length_of :dmsf_description, :maximum => 65535
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user