Add translation tables to Halls

This commit is contained in:
Petko Bordjukov 2015-10-20 10:13:42 +03:00
parent c668a29872
commit 4b82b4c4ac
2 changed files with 15 additions and 0 deletions

View File

@ -3,4 +3,6 @@ class Hall < ActiveRecord::Base
has_many :slots, dependent: :destroy has_many :slots, dependent: :destroy
validates :name, presence: true validates :name, presence: true
translates :name
end end

View File

@ -0,0 +1,13 @@
class AddTranslationsToHalls < ActiveRecord::Migration
def self.up
Hall.create_translation_table!({
:name => :string
}, {
:migrate_data => true
})
end
def self.down
Hall.drop_translation_table! :migrate_data => true
end
end