mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-11 13:15:20 +00:00
Raises 60-character limit for document titles to 255 (#12312).
git-svn-id: http://svn.redmine.org/redmine/trunk@14261 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
77e657b719
commit
f8a9a78ecf
@ -30,7 +30,7 @@ class Document < ActiveRecord::Base
|
|||||||
acts_as_activity_provider :scope => preload(:project)
|
acts_as_activity_provider :scope => preload(:project)
|
||||||
|
|
||||||
validates_presence_of :project, :title, :category
|
validates_presence_of :project, :title, :category
|
||||||
validates_length_of :title, :maximum => 60
|
validates_length_of :title, :maximum => 255
|
||||||
attr_protected :id
|
attr_protected :id
|
||||||
|
|
||||||
after_create :send_notification
|
after_create :send_notification
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
class ChangeDocumentsTitleLimit < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
change_column :documents, :title, :string, :limit => nil, :default => '', :null => false
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
change_column :documents, :title, :string, :limit => 60, :default => '', :null => false
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -433,7 +433,7 @@ div.wiki-page .contextual a {opacity: 0.4}
|
|||||||
div.wiki-page .contextual a:hover {opacity: 1}
|
div.wiki-page .contextual a:hover {opacity: 1}
|
||||||
|
|
||||||
form .attributes select { width: 60%; }
|
form .attributes select { width: 60%; }
|
||||||
input#issue_subject { width: 99%; }
|
input#issue_subject, input#document_title { width: 99%; }
|
||||||
select#issue_done_ratio { width: 95px; }
|
select#issue_done_ratio { width: 95px; }
|
||||||
|
|
||||||
ul.projects {margin:0; padding-left:1em;}
|
ul.projects {margin:0; padding-left:1em;}
|
||||||
|
|||||||
@ -28,6 +28,13 @@ class DocumentTest < ActiveSupport::TestCase
|
|||||||
assert doc.save
|
assert doc.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_create_with_long_title
|
||||||
|
title = 'x'*255
|
||||||
|
doc = Document.new(:project => Project.find(1), :title => title, :category => DocumentCategory.first)
|
||||||
|
assert_save doc
|
||||||
|
assert_equal title, doc.reload.title
|
||||||
|
end
|
||||||
|
|
||||||
def test_create_should_send_email_notification
|
def test_create_should_send_email_notification
|
||||||
ActionMailer::Base.deliveries.clear
|
ActionMailer::Base.deliveries.clear
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user