Show More
Commit Description:
initial commit...
Commit Description:
initial commit
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@1 6386c4cd-e34a-4fa8-8920-d93eb39b512e
References:
File last commit:
Show/Diff file:
Action:
db/migrate/011_add_language_ext.rb
| 15 lines
| 285 B
| text/x-ruby
| RubyLexer
|
|
r0 | class AddLanguageExt < ActiveRecord::Migration | ||
def self.up | ||||
add_column :languages, :ext, :string, :limit => 10 | ||||
langs = Language.find(:all) | ||||
langs.each do |l| | ||||
l.ext = l.name | ||||
l.save | ||||
end | ||||
end | ||||
def self.down | ||||
remove_column :languages, :ext | ||||
end | ||||
end | ||||