Globalize conferences

This commit is contained in:
Petko Bordjukov 2014-09-01 13:44:41 +03:00
parent db933cc634
commit cc6a0066a3
4 changed files with 22 additions and 0 deletions

View File

@ -35,6 +35,8 @@ gem 'capistrano-rvm'
gem 'puma'
gem 'globalize', '~> 4.0.2'
group :development do
gem 'spring'
gem 'spring-commands-rspec'

View File

@ -97,6 +97,9 @@ GEM
i18n (~> 0.5)
ffi (1.9.3)
formatador (0.2.5)
globalize (4.0.2)
activemodel (>= 4.0.0, < 5)
activerecord (>= 4.0.0, < 5)
guard (2.6.1)
formatador (>= 0.2.4)
listen (~> 2.7)
@ -268,6 +271,7 @@ DEPENDENCIES
devise-i18n
factory_girl_rails
faker
globalize (~> 4.0.2)
guard-rspec
jquery-rails
pg

View File

@ -6,6 +6,8 @@ class Conference < ActiveRecord::Base
validates :end_date, presence: true
validate :end_date_is_before_start_date
translates :title, :description
has_many :tracks
has_many :events, through: :tracks

View File

@ -0,0 +1,14 @@
class AddTranslationTablesToConferences < ActiveRecord::Migration
def up
Conference.create_translation_table!({
:title => :string,
:description => :text
}, {
:migrate_data => true
})
end
def down
Post.drop_translation_table! :migrate_data => true
end
end