class Workarea::MagentoMigrator::CatalogProduct
Constants
- COLUMNS
Public Class Methods
table_name()
click to toggle source
# File lib/workarea/magento_migrator/catalog_product.rb, line 31 def table_name @@table_name ||= 'catalog_product' end
Public Instance Methods
convert_to_workarea_product(row)
click to toggle source
# File lib/workarea/magento_migrator/catalog_product.rb, line 20 def convert_to_workarea_product(row) # defined a method to do the mapping job murals_product = [] murals_product << row puts murals_product.inspect # murals_product.to_csv(file_name: 'workarea_product_data.csv') # Import the file to workarea Workarea::DataFile::Import.create(file_name: 'murals_product', file_type: 'csv') end
read_csv_file()
click to toggle source
# File lib/workarea/magento_migrator/catalog_product.rb, line 9 def read_csv_file # parsing the magento csv file file = "lib/data/product_catalog_from_magento.csv" csv = CSV.read(file) # get the column puts col = csv[0].inspect # get the row puts row = csv[1].inspect puts convert_to_workarea_product(row) end