diff --git a/app/models/hall.rb b/app/models/hall.rb index 1bf42eb..86cca85 100644 --- a/app/models/hall.rb +++ b/app/models/hall.rb @@ -3,4 +3,6 @@ class Hall < ActiveRecord::Base has_many :slots, dependent: :destroy validates :name, presence: true + + translates :name end diff --git a/db/migrate/20151020071227_add_translations_to_halls.rb b/db/migrate/20151020071227_add_translations_to_halls.rb new file mode 100644 index 0000000..cb7e3b9 --- /dev/null +++ b/db/migrate/20151020071227_add_translations_to_halls.rb @@ -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