Show More
Commit Description:
fixed error when submitted file is nil...
Commit Description:
fixed error when submitted file is nil
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@366 6386c4cd-e34a-4fa8-8920-d93eb39b512e
References:
File last commit:
Show/Diff file:
Action:
db/migrate/20090416235658_add_common_ext_to_languages.rb
| 23 lines
| 550 B
| text/x-ruby
| RubyLexer
|
|
r166 | class AddCommonExtToLanguages < ActiveRecord::Migration | ||
def self.up | ||||
# language.common_ext is a comma-separated list of common file | ||||
# extensions. | ||||
add_column :languages, :common_ext, :string | ||||
# updating table information | ||||
Language.reset_column_information | ||||
common_ext = { | ||||
'c' => 'c', | ||||
'cpp' => 'cpp,cc', | ||||
'pas' => 'pas' | ||||
} | ||||
Language.find(:all).each do |lang| | ||||
lang.common_ext = common_ext[lang.name] | ||||
lang.save | ||||
end | ||||
end | ||||
def self.down | ||||
remove_column :languages, :common_ext | ||||
end | ||||
end | ||||