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
This commit is contained in:
1 parent
4967fa8733
commit
52547466f0
41 files changed
+80
-60
No files matched your search
@@ -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 = ""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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 %>
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
Reference in new issue
Block a user