summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-25 15:06:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-25 15:06:20 +0000
commit52547466f0f1ce8b41bf1539546aaa28457077a1 (patch)
treeb2ffc5296536fb77afd07bc2a96ad934af5a79a6 /app/controllers
parent4967fa8733e220e2220fdd546df3b46ef5725ac9 (diff)
downloadredmine-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
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects_controller.rb6
-rw-r--r--app/controllers/timelog_controller.rb4
-rw-r--r--app/controllers/wiki_controller.rb6
3 files changed, 8 insertions, 8 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