optional git fuer globalize3 keine Auswirkung

This commit is contained in:
Andreas Stephanides
2013-08-18 20:47:51 +02:00
parent eb13e18fb3
commit 39b381f58e
2 changed files with 19 additions and 0 deletions

View File

@@ -12,9 +12,11 @@
#
class Neuigkeit < ActiveRecord::Base
attr_accessible :datum, :text, :title, :rubrik_id, :author_id
belongs_to :author, :class_name =>'User'
belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id"
validates :rubrik, :presence=>true
validates :author, :presence=>true
translates :title,:text, :versioning=>true, :fallbacks_for_empty_translations => true
end

View File

@@ -0,0 +1,17 @@
class TranslateNeuigkeiten < ActiveRecord::Migration
def self.up
Neuigkeit.create_translation_table!({
:title => :string,
:text => :text
}, {
:migrate_data => true
})
end
def self.down
Neuigkeit.drop_translation_table! :migrate_data => true
end
end