Show More
Commit Description:
merge with rails7 branch
Commit Description:
merge with rails7 branch
References:
File last commit:
Show/Diff file:
Action:
db/migrate/20090416235658_add_common_ext_to_languages.rb | 23 lines | 548 B | text/x-ruby | RubyLexer |
update migration
r822 class AddCommonExtToLanguages < ActiveRecord::Migration[4.2]
jittat
added language identification using file extension...
r166 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'
}
fix migration to work with rails 4 and ruby 2.3
r666 Language.all.each do |lang|
jittat
added language identification using file extension...
r166 lang.common_ext = common_ext[lang.name]
lang.save
end
end
def self.down
remove_column :languages, :common_ext
end
end