Sha256: ffe7aa93529004b675ce7e3833ca5a0808e70c148d2fce7fbae975db8667a200

Contents?: true

Size: 587 Bytes

Versions: 9

Compression:

Stored size: 587 Bytes

Contents

class ArticleTranslation < ActiveRecord::Base
  translation_for :article
end

class Article < ActiveRecord::Base
  translates :name, :content, :class_name => 'ArticleTranslation'
end

class PostTranslation < ActiveRecord::Base
  translation_for :post
end

class Post < ActiveRecord::Base
  translates :name, :content
  validate_translations :en, :ru
end

class Tag < ActiveRecord::Base
  translates :name
end

class Category < ActiveRecord::Base
  translates :name, :attributes => true
end

class Book < ActiveRecord::Base
  translates :name do
    validates_presence_of :name
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
simple_model_translations-0.2.8 spec/data/models.rb
simple_model_translations-0.2.7 spec/data/models.rb
simple_model_translations-0.2.6 spec/data/models.rb
simple_model_translations-0.2.5 spec/data/models.rb
simple_model_translations-0.2.4 spec/data/models.rb
simple_model_translations-0.2.3 spec/data/models.rb
simple_model_translations-0.2.2 spec/data/models.rb
simple_model_translations-0.2.1 spec/data/models.rb
simple_model_translations-0.2.0 spec/data/models.rb