summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/change.rb4
-rw-r--r--db/migrate/20100705164950_change_changes_path_length_limit.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/change.rb b/app/models/change.rb
index 385fe5acb..e5c1585b4 100644
--- a/app/models/change.rb
+++ b/app/models/change.rb
@@ -23,4 +23,8 @@ class Change < ActiveRecord::Base
def relative_path
changeset.repository.relative_path(path)
end
+
+ def before_save
+ path ||= ""
+ end
end
diff --git a/db/migrate/20100705164950_change_changes_path_length_limit.rb b/db/migrate/20100705164950_change_changes_path_length_limit.rb
index 5f34d5dcf..62ba4ec22 100644
--- a/db/migrate/20100705164950_change_changes_path_length_limit.rb
+++ b/db/migrate/20100705164950_change_changes_path_length_limit.rb
@@ -1,6 +1,6 @@
class ChangeChangesPathLengthLimit < ActiveRecord::Migration
def self.up
- change_column :changes, :path, :text, :default => "", :null => false
+ change_column :changes, :path, :text, :null => false
change_column :changes, :from_path, :text
end