mercator_legacy_importer 0.0.1 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +22 -1
- data/app/models/mercator_legacy_importer/asset.rb +6 -3
- data/app/models/mercator_legacy_importer/attachable.rb +7 -4
- data/app/models/mercator_legacy_importer/category.rb +10 -7
- data/app/models/mercator_legacy_importer/category_translation.rb +9 -6
- data/app/models/mercator_legacy_importer/cms_node.rb +8 -5
- data/app/models/mercator_legacy_importer/cms_node_translation.rb +9 -6
- data/app/models/mercator_legacy_importer/connector.rb +8 -5
- data/app/models/mercator_legacy_importer/content.rb +7 -4
- data/app/models/mercator_legacy_importer/content_item.rb +7 -4
- data/app/models/mercator_legacy_importer/country.rb +6 -3
- data/app/models/mercator_legacy_importer/page_template.rb +9 -6
- data/app/models/mercator_legacy_importer/product.rb +12 -9
- data/app/models/mercator_legacy_importer/product_overview_property.rb +6 -3
- data/app/models/mercator_legacy_importer/product_property.rb +8 -5
- data/app/models/mercator_legacy_importer/product_relation.rb +6 -3
- data/app/models/mercator_legacy_importer/product_supply.rb +6 -3
- data/app/models/mercator_legacy_importer/product_translation.rb +10 -7
- data/app/models/mercator_legacy_importer/property.rb +12 -9
- data/app/models/mercator_legacy_importer/property_translation.rb +9 -6
- data/app/models/mercator_legacy_importer/recommendation.rb +9 -7
- data/app/models/mercator_legacy_importer/recommendation_translation.rb +10 -7
- data/app/models/mercator_legacy_importer/user.rb +6 -3
- data/app/views/layouts/mercator_legacy_importer/application.html.erb +10 -11
- data/db/migrate/20131202162757_add_legacy_ids.rb +10 -6
- data/lib/mercator_legacy_importer/version.rb +2 -2
- data/lib/tasks/categories.rake +43 -0
- data/lib/tasks/categorizations.rake +43 -0
- data/lib/tasks/category_images.rake +42 -34
- data/lib/tasks/cms_node_images.rake +91 -81
- data/lib/tasks/content_elements.rake +66 -44
- data/lib/tasks/countries.rake +16 -10
- data/lib/tasks/features.rake +25 -17
- data/lib/tasks/page_template.rake +16 -9
- data/lib/tasks/product_images.rake +25 -8
- data/lib/tasks/product_relations.rake +21 -13
- data/lib/tasks/products.rake +52 -39
- data/lib/tasks/properties.rake +45 -36
- data/lib/tasks/recommendations.rake +30 -19
- data/lib/tasks/remaining_assets.rake +34 -26
- data/lib/tasks/remaining_images.rake +34 -26
- data/lib/tasks/supply_relations.rake +23 -13
- data/lib/tasks/unlinked_content_items.rake +24 -18
- data/lib/tasks/users.rake +43 -10
- data/lib/tasks/webpages.rake +34 -0
- metadata +30 -39
- data/app/helpers/mercator_legacy_importer/application_helper.rb +0 -4
- data/config/database.yml +0 -13
- data/db/migrate/20131202164442_products_add_legacy_id.rb +0 -9
- data/db/migrate/20140103154252_add_legacy_id_to_page.rb +0 -9
- data/db/migrate/20140103161205_add_legacy_id_to_page_template.rb +0 -9
- data/db/migrate/20140104094617_add_legacy_id_to_feature.rb +0 -9
- data/db/migrate/20140107090420_add_legacy_id_to_content_elements.rb +0 -9
- data/lib/tasks/categories.rb +0 -32
- data/lib/tasks/categorizations.rb +0 -35
- data/lib/tasks/mercator_legacy_importer_tasks.rake +0 -34
- data/lib/tasks/pages.rake +0 -27
- data/lib/tasks/unlinked_content_elements.rake +0 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f34a50c820ad9318809e2ff0838fc2d5b227795f
|
4
|
+
data.tar.gz: bb4eba7aecc84afc8d64b60e3546302ba5aa6a9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19949f645e147de206c5b6c164f688b584035eb18293fc1b00401a3846b49cf0f2736c88982f4f3581881f459ba5e182be2f74b0921bd8041c51bbccaa9d35b3
|
7
|
+
data.tar.gz: 2a2e4b838ca3b0c1b45cada56727d83544bff2e0afeb9f2923adaaa50c8e7645da140a4adf5b3ff230dbd3f26c86e418eafc293bee95544c604b88b5c19a6ac6
|
data/README.rdoc
CHANGED
@@ -3,4 +3,25 @@
|
|
3
3
|
This is am sample engine for importing data from a legacy MYSQL database.
|
4
4
|
Look into the models and the lib/tasks folder for examples for connecting to a database and importing data.
|
5
5
|
|
6
|
-
This project uses the GPL V3 license. See file LICENSE in the same directory for details about the GPL V3.
|
6
|
+
This project uses the GPL V3 license. See file LICENSE in the same directory for details about the GPL V3.
|
7
|
+
|
8
|
+
# Installation instructions
|
9
|
+
|
10
|
+
1. Put in your Gemfile
|
11
|
+
'''ruby
|
12
|
+
gem "mercator_legacy_importer"
|
13
|
+
'''
|
14
|
+
2. Instell gem by running
|
15
|
+
'''ruby
|
16
|
+
bundle install
|
17
|
+
'''
|
18
|
+
3.2 Get all migrations into your app by running in your ipp directory
|
19
|
+
'''ruby
|
20
|
+
rake mercator_legacy_importer:install:migrations
|
21
|
+
'''
|
22
|
+
4. Run Migrations added
|
23
|
+
'''ruby
|
24
|
+
rake db:migrate
|
25
|
+
'''
|
26
|
+
5. Mount the Engine in your routes.rb
|
27
|
+
mount MercatorLegacyImporter::Engine => "/mercator_legacy_importer"
|
@@ -1,4 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class Asset < ActiveRecord::Base
|
3
|
+
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'assets'
|
6
|
+
end
|
4
7
|
end
|
@@ -1,6 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'attachables'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class Attachable < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'attachables'
|
6
|
+
|
7
|
+
belongs_to :asset
|
8
|
+
end
|
6
9
|
end
|
@@ -1,10 +1,13 @@
|
|
1
|
-
|
2
|
-
establish_connection "import_development"
|
3
|
-
self.table_name = 'categories'
|
1
|
+
module MercatorLegacyImporter
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
class Category < ActiveRecord::Base
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'categories'
|
8
6
|
|
9
|
-
|
7
|
+
# The following two lines fix the migration issues
|
8
|
+
hobo_model
|
9
|
+
fields
|
10
|
+
|
11
|
+
has_many :category_translations
|
12
|
+
end
|
10
13
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'category_translations'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class CategoryTranslation < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'category_translations'
|
6
|
+
|
7
|
+
belongs_to :category
|
8
|
+
scope :german, -> { where(locale: "de") }
|
9
|
+
scope :english, -> { where(locale: "en") }
|
10
|
+
end
|
8
11
|
end
|
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'cms_nodes'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class CmsNode < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'cms_nodes'
|
6
|
+
|
7
|
+
has_many :cms_node_translations
|
8
|
+
has_many :connectors
|
9
|
+
end
|
7
10
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'cms_node_translations'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class CmsNodeTranslation < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'cms_node_translations'
|
6
|
+
|
7
|
+
belongs_to :cms_node
|
8
|
+
scope :german, -> { where(locale: "de") }
|
9
|
+
scope :english, -> { where(locale: "en") }
|
10
|
+
end
|
8
11
|
end
|
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'connectors'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class Connector < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'connectors'
|
6
|
+
|
7
|
+
belongs_to :content
|
8
|
+
belongs_to :cms_node
|
9
|
+
end
|
7
10
|
end
|
@@ -1,6 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'contents'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class Content < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'contents'
|
6
|
+
|
7
|
+
has_many :connectors
|
8
|
+
end
|
6
9
|
end
|
@@ -1,6 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'content_items'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class ContentItem < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'content_items'
|
6
|
+
|
7
|
+
belongs_to :content
|
8
|
+
end
|
6
9
|
end
|
@@ -1,4 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class Country < ActiveRecord::Base
|
3
|
+
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'zones'
|
6
|
+
end
|
4
7
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'page_templates'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class PageTemplate < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'page_templates'
|
6
|
+
|
7
|
+
# The following two lines fix the migration issues
|
8
|
+
hobo_model
|
9
|
+
fields
|
10
|
+
end
|
8
11
|
end
|
@@ -1,12 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'products'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class Product < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
fields
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'products'
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
# The following two lines fix the migration issues
|
8
|
+
hobo_model
|
9
|
+
fields
|
10
|
+
|
11
|
+
has_many :product_translations
|
12
|
+
has_many :product_properties
|
13
|
+
has_many :properties , :through => :product_properties
|
14
|
+
end
|
12
15
|
end
|
@@ -1,4 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class ProductOverviewProperty < ActiveRecord::Base
|
3
|
+
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'product_overview_properties'
|
6
|
+
end
|
4
7
|
end
|
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'products_properties'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class ProductProperty < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'products_properties'
|
6
|
+
|
7
|
+
belongs_to :product
|
8
|
+
belongs_to :property
|
9
|
+
end
|
7
10
|
end
|
@@ -1,4 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class ProductRelation < ActiveRecord::Base
|
3
|
+
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'product_relations'
|
6
|
+
end
|
4
7
|
end
|
@@ -1,4 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class ProductSupply < ActiveRecord::Base
|
3
|
+
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'product_supplies'
|
6
|
+
end
|
4
7
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'product_translations'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class ProductTranslation < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'product_translations'
|
6
|
+
|
7
|
+
belongs_to :product
|
8
|
+
scope :german, -> { where(locale: "de") }
|
9
|
+
scope :english, -> { where(locale: "en") }
|
10
|
+
end
|
11
|
+
end
|
@@ -1,13 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'properties'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class Property < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
fields
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'properties'
|
8
6
|
|
9
|
-
|
7
|
+
# The following two lines fix the migration issues
|
8
|
+
hobo_model
|
9
|
+
fields
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
has_many :property_translations
|
12
|
+
|
13
|
+
has_many :product_properties
|
14
|
+
has_many :products, :through => :product_properties
|
15
|
+
end
|
13
16
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'property_translations'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class PropertyTranslation < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'property_translations'
|
6
|
+
|
7
|
+
belongs_to :property
|
8
|
+
scope :german, -> { where(locale: "de") }
|
9
|
+
scope :english, -> { where(locale: "en") }
|
10
|
+
end
|
8
11
|
end
|
@@ -1,10 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class Recommendation < ActiveRecord::Base
|
3
|
+
establish_connection "import_development"
|
4
|
+
self.table_name = 'recommendations'
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
# The following two lines fix the migration issues
|
7
|
+
hobo_model
|
8
|
+
fields
|
8
9
|
|
9
|
-
|
10
|
+
has_many :recommendation_translations
|
11
|
+
end
|
10
12
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.table_name = 'recommendation_translations'
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class RecommendationTranslation < ActiveRecord::Base
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'recommendation_translations'
|
6
|
+
|
7
|
+
belongs_to :recommendation
|
8
|
+
scope :german, -> { where(locale: "de") }
|
9
|
+
scope :english, -> { where(locale: "en") }
|
10
|
+
end
|
11
|
+
end
|
@@ -1,4 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module MercatorLegacyImporter
|
2
|
+
class User < ActiveRecord::Base
|
3
|
+
|
4
|
+
establish_connection "import_development"
|
5
|
+
self.table_name = 'ivellio_vellin_customers'
|
6
|
+
end
|
4
7
|
end
|
@@ -1,14 +1,13 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
<head>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
</head>
|
9
|
-
<body>
|
3
|
+
<head>
|
4
|
+
<title>Mercator Legacy Importer</title>
|
5
|
+
<%= stylesheet_link_tag "mercator_legacy_importer/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "mercator_legacy_importer/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
</body>
|
14
|
-
</html>
|
10
|
+
<body>
|
11
|
+
<%= yield %>
|
12
|
+
</body>
|
13
|
+
</html>
|