@@ -0,0 +1,11 | |||
|
1 | class ChangeWikiContentsCommentsLimitTo1024 < ActiveRecord::Migration | |
|
2 | def self.up | |
|
3 | change_column :wiki_content_versions, :comments, :string, :limit => 1024, :default => '' | |
|
4 | change_column :wiki_contents, :comments, :string, :limit => 1024, :default => '' | |
|
5 | end | |
|
6 | ||
|
7 | def self.down | |
|
8 | change_column :wiki_content_versions, :comments, :string, :limit => 255, :default => '' | |
|
9 | change_column :wiki_contents, :comments, :string, :limit => 255, :default => '' | |
|
10 | end | |
|
11 | end |
@@ -22,7 +22,7 class WikiContent < ActiveRecord::Base | |||
|
22 | 22 | belongs_to :page, :class_name => 'WikiPage' |
|
23 | 23 | belongs_to :author, :class_name => 'User' |
|
24 | 24 | validates_presence_of :text |
|
25 |
validates_length_of :comments, :maximum => |
|
|
25 | validates_length_of :comments, :maximum => 1024, :allow_nil => true | |
|
26 | 26 | attr_protected :id |
|
27 | 27 | |
|
28 | 28 | acts_as_versioned |
@@ -29,7 +29,7 | |||
|
29 | 29 | <% end %> |
|
30 | 30 | <% end %> |
|
31 | 31 | |
|
32 | <p><label><%= l(:field_comments) %></label><%= f.text_field :comments, :size => 120 %></p> | |
|
32 | <p><label><%= l(:field_comments) %></label><%= f.text_field :comments, :size => 120, :maxlength => 1024 %></p> | |
|
33 | 33 | <p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p> |
|
34 | 34 | </div> |
|
35 | 35 |
@@ -319,7 +319,7 class WikiControllerTest < ActionController::TestCase | |||
|
319 | 319 | put :update, :project_id => 1, |
|
320 | 320 | :id => 'Another_page', |
|
321 | 321 | :content => { |
|
322 | :comments => 'a' * 300, # failure here, comment is too long | |
|
322 | :comments => 'a' * 1300, # failure here, comment is too long | |
|
323 | 323 | :text => 'edited' |
|
324 | 324 | }, |
|
325 | 325 | :wiki_page => { |
General Comments 0
You need to be logged in to leave comments.
Login now