Globalize conferences #5

Merged
ignisf merged 1 commits from globalize into master 2014-09-01 13:46:41 +03:00
4 changed files with 22 additions and 0 deletions

View File

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

View File

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

View File

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