X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7c6d4e90763dd2f825719e2563582728e3193715..4729163aa8e9bf6a7c9f12a8fcd77e6b632e9d80:/db/migrate/034_create_languages.rb?ds=sidebyside diff --git a/db/migrate/034_create_languages.rb b/db/migrate/034_create_languages.rb index 4b45ce33f..e62a3dff9 100644 --- a/db/migrate/034_create_languages.rb +++ b/db/migrate/034_create_languages.rb @@ -1,4 +1,4 @@ -require 'lib/migrate' +require 'migrate' class CreateLanguages < ActiveRecord::Migration def self.up @@ -10,20 +10,13 @@ class CreateLanguages < ActiveRecord::Migration add_primary_key :languages, [:code] - YAML.load(File.read(RAILS_ROOT + "/config/languages.yml")).each do |k,v| - Language.create do |l| - l.code = k - l.english_name = v["english"] - l.native_name = v["native"] - end - end + Language.load("#{Rails.root}/config/languages.yml") add_foreign_key :users, [:locale], :languages, [:code] add_foreign_key :diary_entries, [:language_code], :languages, [:code] end def self.down - raise IrreversibleMigration.new + raise ActiveRecord::IrreversibleMigration end end -