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:
Jean-Philippe Lang committed 2007-04-25 15:06:20 +00:00
1 parent 4967fa8733
commit 52547466f0
41 files changed
+80 -60

No files matched your search

+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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,
+2 -2
View File
@@ -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
+7 -2
View File
@@ -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