spree_product_translations 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,11 +8,17 @@ In your Gemfile, add:
8
8
 
9
9
  gem 'spree_product_translations'
10
10
 
11
- Then run
11
+ Then install the gem:
12
12
 
13
- rake db:migrate
13
+ bundle install
14
+
15
+ Then copy the migrations to your spree application:
16
+
17
+ rake spree_product_translations:install
14
18
 
15
- to create the translation tables defined in the migrations here.
19
+ Finally migrate your database:
20
+
21
+ rake db:migrate
16
22
 
17
23
  If you have pre-existing data, you'll need to run this rake task:
18
24
 
@@ -0,0 +1,21 @@
1
+ class AddTranslationTables < ActiveRecord::Migration
2
+ def self.up
3
+ Product.create_translation_table! :name => :string, :description => :text, :meta_description => :text, :meta_keywords => :text
4
+ Property.create_translation_table! :presentation => :string
5
+ Prototype.create_translation_table! :name => :string
6
+ Taxonomy.create_translation_table! :name => :string
7
+ Taxon.create_translation_table! :name => :string, :description => :text
8
+ OptionType.create_translation_table! :presentation => :string
9
+ OptionValue.create_translation_table! :presentation => :string
10
+ end
11
+
12
+ def self.down
13
+ Product.drop_translation_table!
14
+ Property.drop_translation_table!
15
+ Prototype.drop_translation_table!
16
+ Taxonomy.drop_translation_table!
17
+ Taxon.drop_translation_table!
18
+ OptionType.drop_translation_table!
19
+ OptionValue.drop_translation_table!
20
+ end
21
+ end
@@ -0,0 +1,9 @@
1
+ class AddDescriptionToTaxonTranslations < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :taxon_translations, :description, :text unless column_exists?(:taxon_translations, :description)
4
+ end
5
+
6
+ def self.down
7
+ remove_column :taxon_translations, :description
8
+ end
9
+ end
@@ -12,7 +12,7 @@ module SpreeProductTranslations
12
12
 
13
13
  ::Product.class_eval do
14
14
  translates :name, :description, :meta_description, :meta_keywords
15
- end
15
+ end
16
16
 
17
17
  ::Property.class_eval do
18
18
  translates :presentation
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_product_translations
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeroen Jacobs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-03 00:00:00 +01:00
18
+ date: 2011-03-04 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -64,6 +64,8 @@ files:
64
64
  - lib/spree_product_translations.rb
65
65
  - lib/tasks/install.rake
66
66
  - lib/tasks/spree_product_translations.rake
67
+ - db/migrate/20090824173314_add_translation_tables.rb
68
+ - db/migrate/20110303123348_add_description_to_taxon_translations.rb
67
69
  has_rdoc: false
68
70
  homepage: https://github.com/jeroenj/spree-product_translations
69
71
  licenses: []