Add translation tables to Halls
This commit is contained in:
parent
c668a29872
commit
4b82b4c4ac
@ -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
|
||||||
|
13
db/migrate/20151020071227_add_translations_to_halls.rb
Normal file
13
db/migrate/20151020071227_add_translations_to_halls.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user