Sha256: d124d4aacc2ff229cd46c21e1ae682c23a08d73a7c8c2a041b3e9f7d406fc7a8

Contents?: true

Size: 778 Bytes

Versions: 1

Compression:

Stored size: 778 Bytes

Contents

ActiveRecord::Schema.define(:version => 1) do
  create_table :users do |t|
  end

  create_table :products do |t|
  end

  %w[translations user_translations].each do |table|
    create_table table do |t|
      t.integer :translatable_id, :null=>false
      t.string :translatable_type, :limit=>40, :null=>false
      t.string :language, :limit=>2, :null=>false
      t.string :attr, :limit=>40, :null=>false
      t.text :text, :null=>false
    end
  end
end

#create model
class User < ActiveRecord::Base
  translated_attributes :name, :table_name=>:user_translations, :nil_to_blank=>true
end

class Shop < ActiveRecord::Base
  set_table_name :products
  translated_attributes :shop_name
end

class Product < ActiveRecord::Base
  translated_attributes :title, :description
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
teonimesic-translated_attributes-0.5.7 spec/models.rb