diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-05-10 08:45:56 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-05-10 08:45:56 +0000 |
commit | f8a9a78ecfa50d53ca8416d296af8a02da8eb7d7 (patch) | |
tree | fa89b8059872fd51c48f2b66a7c4db59d9dc8eb0 | |
parent | 77e657b719f57b31002479a92d8e3a838dfa39a5 (diff) | |
download | redmine-f8a9a78ecfa50d53ca8416d296af8a02da8eb7d7.tar.gz redmine-f8a9a78ecfa50d53ca8416d296af8a02da8eb7d7.zip |
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
-rw-r--r-- | app/models/document.rb | 2 | ||||
-rw-r--r-- | db/migrate/20150510083747_change_documents_title_limit.rb | 9 | ||||
-rw-r--r-- | public/stylesheets/application.css | 2 | ||||
-rw-r--r-- | test/unit/document_test.rb | 7 |
4 files changed, 18 insertions, 2 deletions
diff --git a/app/models/document.rb b/app/models/document.rb index d6b96ac98..a522168fd 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -30,7 +30,7 @@ class Document < ActiveRecord::Base acts_as_activity_provider :scope => preload(:project) validates_presence_of :project, :title, :category - validates_length_of :title, :maximum => 60 + validates_length_of :title, :maximum => 255 attr_protected :id after_create :send_notification diff --git a/db/migrate/20150510083747_change_documents_title_limit.rb b/db/migrate/20150510083747_change_documents_title_limit.rb new file mode 100644 index 000000000..6e3090334 --- /dev/null +++ b/db/migrate/20150510083747_change_documents_title_limit.rb @@ -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 diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index ba483fc1f..16d9ffa5d 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -433,7 +433,7 @@ div.wiki-page .contextual a {opacity: 0.4} div.wiki-page .contextual a:hover {opacity: 1} form .attributes select { width: 60%; } -input#issue_subject { width: 99%; } +input#issue_subject, input#document_title { width: 99%; } select#issue_done_ratio { width: 95px; } ul.projects {margin:0; padding-left:1em;} diff --git a/test/unit/document_test.rb b/test/unit/document_test.rb index 50decb7c7..52500a8eb 100644 --- a/test/unit/document_test.rb +++ b/test/unit/document_test.rb @@ -28,6 +28,13 @@ class DocumentTest < ActiveSupport::TestCase assert doc.save 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 ActionMailer::Base.deliveries.clear |