Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Force the default value of path to be set on the Change model class. …
…This is needed because MySQL does not support default values on text columns (Error introduced in r3828, #5771)
  • Loading branch information
meineerde committed Jul 6, 2010
1 parent 75d5ab4 commit 89cb1b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/models/change.rb
Expand Up @@ -23,4 +23,8 @@ class Change < ActiveRecord::Base
def relative_path
changeset.repository.relative_path(path)
end

def before_save
path ||= ""
end
end
@@ -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

Expand Down

0 comments on commit 89cb1b9

Please sign in to comment.