Permalink
Browse files

rails schema merges

  • Loading branch information...
1 parent 3e4660b commit 2d08af9a0159e50bd6c1ffd9ea40da48ed8caf1e @sj26 committed Apr 21, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 .gitconfig
View
@@ -8,3 +8,14 @@
excludesfile = /Users/sj26/.gitignore
[alias]
blame = blame --abbrev=6
+[merge "railsschema"]
+ name = newer Rails schema version
+ driver = "ruby -e '\n\
+ system %(git), %(merge-file), %(--marker-size=%L), %(%A), %(%O), %(%B)\n\
+ b = File.read(%(%A))\n\
+ b.sub!(/^<+ .*\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n=+\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n>+ .*/) do\n\
+ %(ActiveRecord::Schema.define(:version => #{[$1, $2].max}) do)\n\
+ end\n\
+ File.open(%(%A), %(w)) {|f| f.write(b)}\n\
+ exit 1 if b.include?(%(<)*%L)'"
+

0 comments on commit 2d08af9

Please sign in to comment.