##// END OF EJS Templates
Raises 60-character limit for document titles to 255 (#12312)....
Jean-Philippe Lang -
r13879:f8a9a78ecfa5
parent child
Show More
@@ -0,0 +1,9
1 class ChangeDocumentsTitleLimit < ActiveRecord::Migration
2 def self.up
3 change_column :documents, :title, :string, :limit => nil, :default => '', :null => false
4 end
5
6 def self.down
7 change_column :documents, :title, :string, :limit => 60, :default => '', :null => false
8 end
9 end
@@ -30,7 +30,7 class Document < ActiveRecord::Base
30 acts_as_activity_provider :scope => preload(:project)
30 acts_as_activity_provider :scope => preload(:project)
31
31
32 validates_presence_of :project, :title, :category
32 validates_presence_of :project, :title, :category
33 validates_length_of :title, :maximum => 60
33 validates_length_of :title, :maximum => 255
34 attr_protected :id
34 attr_protected :id
35
35
36 after_create :send_notification
36 after_create :send_notification
@@ -433,7 +433,7 div.wiki-page .contextual a {opacity: 0.4}
433 div.wiki-page .contextual a:hover {opacity: 1}
433 div.wiki-page .contextual a:hover {opacity: 1}
434
434
435 form .attributes select { width: 60%; }
435 form .attributes select { width: 60%; }
436 input#issue_subject { width: 99%; }
436 input#issue_subject, input#document_title { width: 99%; }
437 select#issue_done_ratio { width: 95px; }
437 select#issue_done_ratio { width: 95px; }
438
438
439 ul.projects {margin:0; padding-left:1em;}
439 ul.projects {margin:0; padding-left:1em;}
@@ -28,6 +28,13 class DocumentTest < ActiveSupport::TestCase
28 assert doc.save
28 assert doc.save
29 end
29 end
30
30
31 def test_create_with_long_title
32 title = 'x'*255
33 doc = Document.new(:project => Project.find(1), :title => title, :category => DocumentCategory.first)
34 assert_save doc
35 assert_equal title, doc.reload.title
36 end
37
31 def test_create_should_send_email_notification
38 def test_create_should_send_email_notification
32 ActionMailer::Base.deliveries.clear
39 ActionMailer::Base.deliveries.clear
33
40
General Comments 0
You need to be logged in to leave comments. Login now