Globalize conferences
This commit is contained in:
parent
db933cc634
commit
cc6a0066a3
2
Gemfile
2
Gemfile
|
@ -35,6 +35,8 @@ gem 'capistrano-rvm'
|
|||
|
||||
gem 'puma'
|
||||
|
||||
gem 'globalize', '~> 4.0.2'
|
||||
|
||||
group :development do
|
||||
gem 'spring'
|
||||
gem 'spring-commands-rspec'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue