@@ -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 | 30 | acts_as_activity_provider :scope => preload(:project) |
|
31 | 31 | |
|
32 | 32 | validates_presence_of :project, :title, :category |
|
33 |
validates_length_of :title, :maximum => |
|
|
33 | validates_length_of :title, :maximum => 255 | |
|
34 | 34 | attr_protected :id |
|
35 | 35 | |
|
36 | 36 | after_create :send_notification |
@@ -433,7 +433,7 div.wiki-page .contextual a {opacity: 0.4} | |||
|
433 | 433 | div.wiki-page .contextual a:hover {opacity: 1} |
|
434 | 434 | |
|
435 | 435 | form .attributes select { width: 60%; } |
|
436 | input#issue_subject { width: 99%; } | |
|
436 | input#issue_subject, input#document_title { width: 99%; } | |
|
437 | 437 | select#issue_done_ratio { width: 95px; } |
|
438 | 438 | |
|
439 | 439 | ul.projects {margin:0; padding-left:1em;} |
@@ -28,6 +28,13 class DocumentTest < ActiveSupport::TestCase | |||
|
28 | 28 | assert doc.save |
|
29 | 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 | 38 | def test_create_should_send_email_notification |
|
32 | 39 | ActionMailer::Base.deliveries.clear |
|
33 | 40 |
General Comments 0
You need to be logged in to leave comments.
Login now