diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-25 15:06:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-25 15:06:20 +0000 |
commit | 52547466f0f1ce8b41bf1539546aaa28457077a1 (patch) | |
tree | b2ffc5296536fb77afd07bc2a96ad934af5a79a6 | |
parent | 4967fa8733e220e2220fdd546df3b46ef5725ac9 (diff) | |
download | redmine-52547466f0f1ce8b41bf1539546aaa28457077a1.tar.gz redmine-52547466f0f1ce8b41bf1539546aaa28457077a1.zip |
Fixed: 10342 Creation of Schema in Oracle
Comment is a reserved keyword for Oracle. The five 'Comment' columns are renamed to 'Commments'.
Migration scripts were modified to let oracle users create the database. For the others, migration 41 will rename the columns (only if columns have the 'old' name).
Fixed also a few oracle specific issues.
Note: currently (in Rails 1.2.3), there's bug in Rails oracle adapter. See: http://dev.rubyonrails.org/ticket/7344
Attached patch is required for redMine to work properly.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@479 e93f8b46-1217-0410-a6f0-8f06a7374b81
41 files changed, 80 insertions, 60 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 19f93de96..c94810aa8 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -503,7 +503,7 @@ class ProjectsController < ApplicationController end unless params[:show_wiki_edits] == "0" - select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comment, " + + select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comments, " + "#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title" joins = "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " + "LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id " @@ -624,7 +624,7 @@ class ProjectsController < ApplicationController # no more than 5 tokens to search for @tokens.slice! 5..-1 if @tokens.size > 5 # strings used in sql like statement - like_tokens = @tokens.collect {|w| "%#{w}%"} + like_tokens = @tokens.collect {|w| "%#{w.downcase}%"} operator = @all_words ? " AND " : " OR " limit = 10 @results = [] @@ -632,7 +632,7 @@ class ProjectsController < ApplicationController @results += @project.news.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort], :include => :author ) if @scope.include? 'news' @results += @project.documents.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'documents' @results += @project.wiki.pages.find(:all, :limit => limit, :include => :content, :conditions => [ (["(LOWER(title) like ? OR LOWER(text) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @project.wiki && @scope.include?('wiki') - @results += @project.repository.changesets.find(:all, :limit => limit, :conditions => [ (["(LOWER(comment) like ?)"] * like_tokens.size).join(operator), * (like_tokens).sort] ) if @project.repository && @scope.include?('changesets') + @results += @project.repository.changesets.find(:all, :limit => limit, :conditions => [ (["(LOWER(comments) like ?)"] * like_tokens.size).join(operator), * (like_tokens).sort] ) if @project.repository && @scope.include?('changesets') @question = @tokens.join(" ") else @question = "" diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index 5902390d4..c07a76060 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -59,7 +59,7 @@ private l(:field_activity), l(:field_issue), l(:field_hours), - l(:field_comment) + l(:field_comments) ] csv << headers.collect {|c| ic.iconv(c) } # csv lines @@ -69,7 +69,7 @@ private entry.activity.name, (entry.issue ? entry.issue.id : nil), entry.hours, - entry.comment + entry.comments ] csv << fields.collect {|c| ic.iconv(c.to_s) } end diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 5931a93ad..9e750b3a6 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -47,7 +47,7 @@ class WikiController < ApplicationController @content = @page.content_for_version(params[:version]) @content.text = "h1. #{@page.pretty_title}" if @content.text.blank? # don't keep previous comment - @content.comment = nil + @content.comments = nil if request.post? if @content.text == params[:content][:text] # don't save if text wasn't changed @@ -55,7 +55,7 @@ class WikiController < ApplicationController return end @content.text = params[:content][:text] - @content.comment = params[:content][:comment] + @content.comments = params[:content][:comments] @content.author = logged_in_user # if page is new @page.save will also save content, but not if page isn't a new record if (@page.new_record? ? @page.save : @content.save) @@ -69,7 +69,7 @@ class WikiController < ApplicationController @page = @wiki.find_page(params[:page]) # don't load text @versions = @page.content.versions.find :all, - :select => "id, author_id, comment, updated_on, version", + :select => "id, author_id, comments, updated_on, version", :order => 'version DESC' end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2583116c8..ed068a758 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -113,6 +113,8 @@ module ApplicationHelper # textilize text according to system settings and RedCloth availability def textilizable(text, options = {}) + return "" if text.blank? + # different methods for formatting wiki links case options[:wiki_links] when :local diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 824fa12f5..2038266f9 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -34,7 +34,7 @@ class Changeset < ActiveRecord::Base end def scan_comment_for_issue_ids - return if comment.blank? + return if comments.blank? # keywords used to reference issues ref_keywords = Setting.commit_ref_keywords.downcase.split(",") # keywords used to fix issues @@ -48,7 +48,7 @@ class Changeset < ActiveRecord::Base # remove any associated issues self.issues.clear - comment.scan(Regexp.new("(#{kw_regexp})[\s:]+(([\s,;&]*#?\\d+)+)", Regexp::IGNORECASE)).each do |match| + comments.scan(Regexp.new("(#{kw_regexp})[\s:]+(([\s,;&]*#?\\d+)+)", Regexp::IGNORECASE)).each do |match| action = match[0] target_issue_ids = match[1].scan(/\d+/) target_issues = repository.project.issues.find_all_by_id(target_issue_ids) diff --git a/app/models/comment.rb b/app/models/comment.rb index 27e5c511e..88d5348da 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -19,5 +19,5 @@ class Comment < ActiveRecord::Base belongs_to :commented, :polymorphic => true, :counter_cache => true belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' - validates_presence_of :commented, :author, :comment + validates_presence_of :commented, :author, :comments end diff --git a/app/models/custom_value.rb b/app/models/custom_value.rb index a1b2c9c40..e12c14376 100644 --- a/app/models/custom_value.rb +++ b/app/models/custom_value.rb @@ -22,7 +22,7 @@ class CustomValue < ActiveRecord::Base protected def validate errors.add(:value, :activerecord_error_blank) and return if custom_field.is_required? and value.empty? - errors.add(:value, :activerecord_error_invalid) unless custom_field.regexp.empty? or value =~ Regexp.new(custom_field.regexp) + errors.add(:value, :activerecord_error_invalid) unless custom_field.regexp.blank? or value =~ Regexp.new(custom_field.regexp) errors.add(:value, :activerecord_error_too_short) if custom_field.min_length > 0 and value.length < custom_field.min_length and value.length > 0 errors.add(:value, :activerecord_error_too_long) if custom_field.max_length > 0 and value.length > custom_field.max_length case custom_field.field_format diff --git a/app/models/repository.rb b/app/models/repository.rb index 5b7feb79f..02dfda6b7 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -62,7 +62,7 @@ class Repository < ActiveRecord::Base :revision => revision.identifier, :committer => revision.author, :committed_on => revision.time, - :comment => revision.message) + :comments => revision.message) revision.paths.each do |change| Change.create(:changeset => changeset, diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb index 984c2c3a0..c37f5dc86 100644 --- a/app/models/time_entry.rb +++ b/app/models/time_entry.rb @@ -10,7 +10,7 @@ class TimeEntry < ActiveRecord::Base validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on validates_numericality_of :hours, :allow_nil => true - validates_length_of :comment, :maximum => 255 + validates_length_of :comments, :maximum => 255 def before_validation self.project = issue.project if issue && project.nil? @@ -28,6 +28,6 @@ class TimeEntry < ActiveRecord::Base super self.tyear = spent_on ? spent_on.year : nil self.tmonth = spent_on ? spent_on.month : nil - self.tweek = spent_on ? spent_on.cweek : nil + self.tweek = spent_on ? Date.civil(spent_on.year, spent_on.month, spent_on.day).cweek : nil end end diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb index d9601d516..1ed9e0fd9 100644 --- a/app/models/user_preference.rb +++ b/app/models/user_preference.rb @@ -26,11 +26,15 @@ class UserPreference < ActiveRecord::Base self.others ||= {} end + def before_save + self.others ||= {} + end + def [](attr_name) if attribute_present? attr_name super else - others[attr_name] + others ? others[attr_name] : nil end end @@ -38,7 +42,8 @@ class UserPreference < ActiveRecord::Base if attribute_present? attr_name super else - others.store attr_name, value + self.others ||= {} + self.others.store attr_name, value end end end diff --git a/app/views/news/show.rhtml b/app/views/news/show.rhtml index 024bd00fd..30e746aef 100644 --- a/app/views/news/show.rhtml +++ b/app/views/news/show.rhtml @@ -19,14 +19,14 @@ <div class="contextual"> <%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> </div> - <%= simple_format(auto_link(h comment.comment))%> + <%= simple_format(auto_link(h comment.comments))%> <% end if @news.comments_count > 0 %> </div> <% if authorize_for 'news', 'add_comment' %> -<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comment" %></p> +<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p> <% form_tag({:action => 'add_comment', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %> -<%= text_area 'comment', 'comment', :cols => 60, :rows => 6 %> +<%= text_area 'comment', 'comments', :cols => 60, :rows => 6 %> <p><%= submit_tag l(:button_add) %></p> <% end %> <% end %>
\ No newline at end of file diff --git a/app/views/projects/activity.rhtml b/app/views/projects/activity.rhtml index a0d419884..0ade2335d 100644 --- a/app/views/projects/activity.rhtml +++ b/app/views/projects/activity.rhtml @@ -39,10 +39,10 @@ <%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to h(e.title), :controller => 'documents', :action => 'show', :id => e %><br /> <% elsif e.is_a? WikiContent.versioned_class %> <%= e.created_on.strftime("%H:%M") %> <%=l(:label_wiki_edit)%>: <%= link_to h(WikiPage.pretty_title(e.title)), :controller => 'wiki', :page => e.title %> (<%= link_to '#' + e.version.to_s, :controller => 'wiki', :page => e.title, :version => e.version %>)<br /> - <% unless e.comment.blank? %><em><%=h e.comment %></em><% end %> + <% unless e.comments.blank? %><em><%=h e.comments %></em><% end %> <% elsif e.is_a? Changeset %> <%= e.created_on.strftime("%H:%M") %> <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br /> - <em><%=h e.committer.blank? ? "anonymous" : e.committer %><%= h(": #{truncate(e.comment, 500)}") unless e.comment.blank? %></em> + <em><%=h e.committer.blank? ? "anonymous" : e.committer %><%= h(": #{truncate(e.comments, 500)}") unless e.comments.blank? %></em> <% end %> </p></li> diff --git a/app/views/projects/search.rhtml b/app/views/projects/search.rhtml index 7f2998e7d..d13302b6c 100644 --- a/app/views/projects/search.rhtml +++ b/app/views/projects/search.rhtml @@ -41,7 +41,7 @@ <i><%= e.content.author ? e.content.author.name : "Anonymous" %>, <%= format_time(e.content.updated_on) %></i> <% elsif e.is_a? Changeset %> <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br /> - <%= highlight_tokens(e.comment, @tokens) %><br /> + <%= highlight_tokens(e.comments, @tokens) %><br /> <em><%= e.committer.blank? ? e.committer : "Anonymous" %>, <%= format_time(e.committed_on) %></em> <% end %> </p></li> diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml index c8f109ea4..2afeb8253 100644 --- a/app/views/projects/show.rhtml +++ b/app/views/projects/show.rhtml @@ -7,7 +7,7 @@ <div class="splitcontentleft"> <%= textilizable @project.description %> <ul> - <% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %> + <% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %> <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li> <% unless @project.parent.nil? %> <li><%=l(:field_parent)%>: <%= link_to @project.parent.name, :controller => 'projects', :action => 'show', :id => @project.parent %></li> diff --git a/app/views/repositories/_revisions.rhtml b/app/views/repositories/_revisions.rhtml index a7dfbb66f..c297b5d03 100644 --- a/app/views/repositories/_revisions.rhtml +++ b/app/views/repositories/_revisions.rhtml @@ -3,7 +3,7 @@ <th>#</th> <th><%= l(:label_date) %></th> <th><%= l(:field_author) %></th> -<th><%= l(:field_comment) %></th> +<th><%= l(:field_comments) %></th> <th></th> </tr></thead> <tbody> @@ -12,7 +12,7 @@ <th align="center" style="width:5%"><%= link_to changeset.revision, :action => 'revision', :id => project, :rev => changeset.revision %></th> <td align="center" style="width:15%"><%= format_time(changeset.committed_on) %></td> <td align="center" style="width:15%"><em><%=h changeset.committer %></em></td> -<td align="left"><%= textilizable(changeset.comment) %></td> +<td align="left"><%= textilizable(changeset.comments) %></td> <td align="center"><%= link_to l(:label_view_diff), :action => 'diff', :id => project, :path => path, :rev => changeset.revision if entry && entry.is_file? && changeset != changesets.last %></td> </tr> <% end %> diff --git a/app/views/repositories/revision.rhtml b/app/views/repositories/revision.rhtml index b443e8c64..4fa8bd204 100644 --- a/app/views/repositories/revision.rhtml +++ b/app/views/repositories/revision.rhtml @@ -8,7 +8,7 @@ <h2><%= l(:label_revision) %> <%= @changeset.revision %></h2> <p><em><%= @changeset.committer %>, <%= format_time(@changeset.committed_on) %></em></p> -<%= textilizable @changeset.comment %> +<%= textilizable @changeset.comments %> <% if @changeset.issues.any? %> <h3><%= l(:label_related_issues) %></h3> diff --git a/app/views/timelog/details.rhtml b/app/views/timelog/details.rhtml index f85eb0f5a..4ceca97be 100644 --- a/app/views/timelog/details.rhtml +++ b/app/views/timelog/details.rhtml @@ -16,7 +16,7 @@ <%= sort_header_tag('user_id', :caption => l(:label_member)) %>
<%= sort_header_tag('activity_id', :caption => l(:label_activity)) %>
<%= sort_header_tag('issue_id', :caption => l(:label_issue)) %>
-<th><%= l(:label_comment) %></th>
+<th><%= l(:label_comments) %></th>
<%= sort_header_tag('hours', :caption => l(:field_hours)) %>
<th></th>
</thead>
@@ -36,7 +36,7 @@ </div>
<% end %>
</td>
-<td><%=h entry.comment %></td>
+<td><%=h entry.comments %></td>
<td align="center"><strong><%= entry.hours %></strong></td>
<td align="center"><%= link_to_if_authorized(l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => entry}, :class => "icon icon-edit") if entry.user_id == @owner_id %></td>
</tr>
diff --git a/app/views/timelog/edit.rhtml b/app/views/timelog/edit.rhtml index b826f7be7..13d76f1ef 100644 --- a/app/views/timelog/edit.rhtml +++ b/app/views/timelog/edit.rhtml @@ -7,7 +7,7 @@ <p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
<p><%= f.text_field :hours, :size => 6, :required => true %></p>
-<p><%= f.text_field :comment, :size => 100 %></p>
+<p><%= f.text_field :comments, :size => 100 %></p>
<p><%= f.select :activity_id, (@activities.collect {|p| [p.name, p.id]}), :required => true %></p>
</div>
diff --git a/app/views/wiki/edit.rhtml b/app/views/wiki/edit.rhtml index 0bc6322f9..af0b24df0 100644 --- a/app/views/wiki/edit.rhtml +++ b/app/views/wiki/edit.rhtml @@ -12,7 +12,7 @@ :onclick => "window.open('#{ url_for :controller => 'help', :ctrl => 'wiki', :page => 'syntax' }', '', 'resizable=yes, location=no, width=300, height=500, menubar=no, status=no, scrollbars=yes'); return false;" %> </div> <p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit' %></p> -<p><label><%= l(:field_comment) %></label><br /><%= f.text_field :comment, :size => 120 %></p> +<p><label><%= l(:field_comments) %></label><br /><%= f.text_field :comments, :size => 120 %></p> <p><%= submit_tag l(:button_save) %> <%= link_to_remote l(:label_preview), { :url => { :controller => 'wiki', :action => 'preview', :id => @project, :page => @page.title }, diff --git a/app/views/wiki/history.rhtml b/app/views/wiki/history.rhtml index dd9e590be..78dc70cc5 100644 --- a/app/views/wiki/history.rhtml +++ b/app/views/wiki/history.rhtml @@ -11,7 +11,7 @@ <th>#</th> <th><%= l(:field_updated_on) %></th> <th><%= l(:field_author) %></th> - <th><%= l(:field_comment) %></th> + <th><%= l(:field_comments) %></th> </tr></thead> <tbody> <% @versions.each do |ver| %> @@ -19,7 +19,7 @@ <th align="center"><%= link_to ver.version, :action => 'index', :page => @page.title, :version => ver.version %></th> <td align="center"><%= format_time(ver.updated_on) %></td> <td><em><%= ver.author ? ver.author.name : "anonyme" %></em></td> - <td><%=h ver.comment %></td> + <td><%=h ver.comments %></td> </tr> <% end %> </tbody> diff --git a/app/views/wiki/show.rhtml b/app/views/wiki/show.rhtml index e4e1bc38d..a65b1a61e 100644 --- a/app/views/wiki/show.rhtml +++ b/app/views/wiki/show.rhtml @@ -13,7 +13,7 @@ <%= link_to(l(:label_current_version), :action => 'index', :page => @page.title) %> <br /> <em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br /> - <%=h @content.comment %> + <%=h @content.comments %> </p> <hr /> <% end %> diff --git a/config/environments/test_oracle.rb b/config/environments/test_oracle.rb index 35bb19bee..0eb1cd6c1 100644 --- a/config/environments/test_oracle.rb +++ b/config/environments/test_oracle.rb @@ -4,7 +4,7 @@ # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! -config.cache_classes = true +config.cache_classes = false # Log error messages when you accidentally call methods on nil. config.whiny_nils = true diff --git a/db/migrate/010_create_comments.rb b/db/migrate/010_create_comments.rb index d804140b0..29e1116af 100644 --- a/db/migrate/010_create_comments.rb +++ b/db/migrate/010_create_comments.rb @@ -4,7 +4,7 @@ class CreateComments < ActiveRecord::Migration t.column :commented_type, :string, :limit => 30, :default => "", :null => false t.column :commented_id, :integer, :default => 0, :null => false t.column :author_id, :integer, :default => 0, :null => false - t.column :comment, :text + t.column :comments, :text t.column :created_on, :datetime, :null => false t.column :updated_on, :datetime, :null => false end diff --git a/db/migrate/029_create_wiki_contents.rb b/db/migrate/029_create_wiki_contents.rb index fde2d22d0..c5c9f2a45 100644 --- a/db/migrate/029_create_wiki_contents.rb +++ b/db/migrate/029_create_wiki_contents.rb @@ -4,7 +4,7 @@ class CreateWikiContents < ActiveRecord::Migration t.column :page_id, :integer, :null => false t.column :author_id, :integer t.column :text, :text - t.column :comment, :string, :limit => 255, :default => "" + t.column :comments, :string, :limit => 255, :default => "" t.column :updated_on, :datetime, :null => false t.column :version, :integer, :null => false end @@ -16,7 +16,7 @@ class CreateWikiContents < ActiveRecord::Migration t.column :author_id, :integer t.column :data, :binary t.column :compression, :string, :limit => 6, :default => "" - t.column :comment, :string, :limit => 255, :default => "" + t.column :comments, :string, :limit => 255, :default => "" t.column :updated_on, :datetime, :null => false t.column :version, :integer, :null => false end diff --git a/db/migrate/032_create_time_entries.rb b/db/migrate/032_create_time_entries.rb index e055c13e6..9b9a54eb1 100644 --- a/db/migrate/032_create_time_entries.rb +++ b/db/migrate/032_create_time_entries.rb @@ -5,7 +5,7 @@ class CreateTimeEntries < ActiveRecord::Migration t.column :user_id, :integer, :null => false t.column :issue_id, :integer t.column :hours, :float, :null => false - t.column :comment, :string, :limit => 255 + t.column :comments, :string, :limit => 255 t.column :activity_id, :integer, :null => false t.column :spent_on, :date, :null => false t.column :tyear, :integer, :null => false diff --git a/db/migrate/034_create_changesets.rb b/db/migrate/034_create_changesets.rb index a78c8e36f..612fd46bb 100644 --- a/db/migrate/034_create_changesets.rb +++ b/db/migrate/034_create_changesets.rb @@ -5,7 +5,7 @@ class CreateChangesets < ActiveRecord::Migration t.column :revision, :integer, :null => false t.column :committer, :string, :limit => 30 t.column :committed_on, :datetime, :null => false - t.column :comment, :text + t.column :comments, :text end add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev end diff --git a/db/migrate/041_rename_comment_to_comments.rb b/db/migrate/041_rename_comment_to_comments.rb new file mode 100644 index 000000000..aedad0022 --- /dev/null +++ b/db/migrate/041_rename_comment_to_comments.rb @@ -0,0 +1,13 @@ +class RenameCommentToComments < ActiveRecord::Migration + def self.up + rename_column(:comments, :comment, :comments) if ActiveRecord::Base.connection.columns("comments").detect{|c| c.name == "comment"} + rename_column(:wiki_contents, :comment, :comments) if ActiveRecord::Base.connection.columns("wiki_contents").detect{|c| c.name == "comment"} + rename_column(:wiki_content_versions, :comment, :comments) if ActiveRecord::Base.connection.columns("wiki_content_versions").detect{|c| c.name == "comment"} + rename_column(:time_entries, :comment, :comments) if ActiveRecord::Base.connection.columns("time_entries").detect{|c| c.name == "comment"} + rename_column(:changesets, :comment, :comments) if ActiveRecord::Base.connection.columns("changesets").detect{|c| c.name == "comment"} + end + + def self.down + raise IrreversibleMigration + end +end diff --git a/lang/de.yml b/lang/de.yml index 40122081b..8785640fd 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -139,7 +139,7 @@ field_start_date: Beginn field_done_ratio: %% erledigt field_auth_source: Authentifizierungs-Modus field_hide_mail: Email Adresse nicht anzeigen -field_comment: Kommentar +field_comments: Kommentar field_url: URL field_start_page: Hauptseite field_subproject: Subprojekt von diff --git a/lang/en.yml b/lang/en.yml index 2c1ea280c..9e6016251 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -139,7 +139,7 @@ field_start_date: Start field_done_ratio: %% Done field_auth_source: Authentication mode field_hide_mail: Hide my email address -field_comment: Comment +field_comments: Comment field_url: URL field_start_page: Start page field_subproject: Subproject diff --git a/lang/es.yml b/lang/es.yml index 12f52301a..2453e232c 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -139,7 +139,7 @@ field_start_date: Comienzo field_done_ratio: %% Realizado field_auth_source: Modo de la autentificación field_hide_mail: Ocultar mi email address -field_comment: Comentario +field_comments: Comentario field_url: URL field_start_page: Página principal field_subproject: Proyecto secundario diff --git a/lang/fr.yml b/lang/fr.yml index 68336f6f4..cddf467a2 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -139,7 +139,7 @@ field_start_date: Début field_done_ratio: %% Réalisé field_auth_source: Mode d'authentification field_hide_mail: Cacher mon adresse mail -field_comment: Commentaire +field_comments: Commentaire field_url: URL field_start_page: Page de démarrage field_subproject: Sous-projet diff --git a/lang/it.yml b/lang/it.yml index 0c12db675..42ff23f76 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -139,7 +139,7 @@ field_start_date: Inizio field_done_ratio: %% completo field_auth_source: Modalità di autenticazione field_hide_mail: Nascondi il mio indirizzo di e-mail -field_comment: Commento +field_comments: Commento field_url: URL field_start_page: Pagina principale field_subproject: Sottoprogetto diff --git a/lang/ja.yml b/lang/ja.yml index 82f430ead..10833b902 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -140,7 +140,7 @@ field_start_date: 開始日 field_done_ratio: 進捗 %% field_auth_source: 認証モード field_hide_mail: メールアドレスを隠す -field_comment: コメント +field_comments: コメント field_url: URL field_start_page: メインページ field_subproject: サブプロジェクト diff --git a/lang/pt.yml b/lang/pt.yml index 8d3bb2146..658872c1e 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -139,7 +139,7 @@ field_start_date: Inicio field_done_ratio: %% Terminado field_auth_source: Modo de autenticacao field_hide_mail: Esconder meu email -field_comment: Comentario +field_comments: Comentario field_url: URL field_start_page: Pagina inicial field_subproject: Sub-projeto diff --git a/lang/zh.yml b/lang/zh.yml index 1b6556a86..e125310df 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -142,7 +142,7 @@ field_start_date: 开始 field_done_ratio: %% 完成 field_auth_source: 认证模式 field_hide_mail: 隐藏我的邮件 -field_comment: 注释 +field_comments: 注释 field_url: URL field_start_page: 起始页 field_subproject: 子项目 diff --git a/test/fixtures/changesets.yml b/test/fixtures/changesets.yml index 10adc5d8f..1fb8ba64b 100644 --- a/test/fixtures/changesets.yml +++ b/test/fixtures/changesets.yml @@ -4,7 +4,7 @@ changesets_001: committed_on: 2007-04-11 15:14:44 +02:00
revision: 1
id: 100
- comment: My very first commit
+ comments: My very first commit
repository_id: 10
committer: dlopper
changesets_002:
@@ -12,7 +12,7 @@ changesets_002: committed_on: 2007-04-12 15:14:44 +02:00
revision: 2
id: 101
- comment: 'This commit fixes #1, #2 and references #3'
+ comments: 'This commit fixes #1, #2 and references #3'
repository_id: 10
committer: dlopper
changesets_003:
@@ -20,7 +20,7 @@ changesets_003: committed_on: 2007-04-12 15:14:44 +02:00
revision: 3
id: 102
- comment: |-
+ comments: |-
A commit with wrong issue ids
IssueID 666 3
repository_id: 10
@@ -30,7 +30,7 @@ changesets_004: committed_on: 2007-04-12 15:14:44 +02:00
revision: 4
id: 103
- comment: |-
+ comments: |-
A commit with an issue id of an other project
IssueID 4 2
repository_id: 10
diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml index 24a4546aa..b60a68b84 100644 --- a/test/fixtures/comments.yml +++ b/test/fixtures/comments.yml @@ -4,7 +4,7 @@ comments_001: commented_id: 1 id: 1 author_id: 1 - comment: my first comment + comments: my first comment created_on: 2006-12-10 18:10:10 +01:00 updated_on: 2006-12-10 18:10:10 +01:00
\ No newline at end of file diff --git a/test/fixtures/wiki_content_versions.yml b/test/fixtures/wiki_content_versions.yml index 784b3b03f..c433fc5dd 100644 --- a/test/fixtures/wiki_content_versions.yml +++ b/test/fixtures/wiki_content_versions.yml @@ -5,7 +5,7 @@ wiki_content_versions_001: id: 1
version: 1
author_id: 1
- comment: Page creation
+ comments: Page creation
wiki_content_id: 1
compression: ""
data: |-
@@ -18,7 +18,7 @@ wiki_content_versions_002: id: 2
version: 2
author_id: 1
- comment: Small update
+ comments: Small update
wiki_content_id: 1
compression: ""
data: |-
@@ -31,7 +31,7 @@ wiki_content_versions_003: id: 3
version: 3
author_id: 1
- comment: ""
+ comments: ""
wiki_content_id: 1
compression: ""
data: |-
diff --git a/test/fixtures/wiki_contents.yml b/test/fixtures/wiki_contents.yml index ce1c8bd74..1f4ffc36d 100644 --- a/test/fixtures/wiki_contents.yml +++ b/test/fixtures/wiki_contents.yml @@ -9,4 +9,4 @@ wiki_contents_001: id: 1
version: 3
author_id: 1
- comment: Gzip compression activated
+ comments: Gzip compression activated
diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb index 301704a94..c07ee8273 100644 --- a/test/unit/comment_test.rb +++ b/test/unit/comment_test.rb @@ -26,7 +26,7 @@ class CommentTest < Test::Unit::TestCase end def test_create - comment = Comment.new(:commented => @news, :author => @jsmith, :comment => "my comment") + comment = Comment.new(:commented => @news, :author => @jsmith, :comments => "my comment") assert comment.save @news.reload assert_equal 2, @news.comments_count diff --git a/test/unit/wiki_content_test.rb b/test/unit/wiki_content_test.rb index a6b714ebe..a8c28ae21 100644 --- a/test/unit/wiki_content_test.rb +++ b/test/unit/wiki_content_test.rb @@ -27,7 +27,7 @@ class WikiContentTest < Test::Unit::TestCase def test_create page = WikiPage.new(:wiki => @wiki, :title => "Page") - page.content = WikiContent.new(:text => "Content text", :author => User.find(1), :comment => "My comment") + page.content = WikiContent.new(:text => "Content text", :author => User.find(1), :comments => "My comment") assert page.save page.reload @@ -36,7 +36,7 @@ class WikiContentTest < Test::Unit::TestCase assert_equal 1, content.version assert_equal 1, content.versions.length assert_equal "Content text", content.text - assert_equal "My comment", content.comment + assert_equal "My comment", content.comments assert_equal User.find(1), content.author assert_equal content.text, content.versions.last.text end |