-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes to exporter to discourage use of strings
- Loading branch information
Showing
3 changed files
with
41 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
class BelboonArticleExporter < Exporter::CSVExporter | ||
mapping do | ||
field 'Merchant_ProductNumber' => 'slug' | ||
field 'EAN_Code' => 'gtin' | ||
field 'Product_Title' => 'title' | ||
field 'Manufacturer' => nil | ||
field 'Brand' => nil | ||
field 'Price' => "Money.new(self.price_cents).to_s.gsub(',', '.')" | ||
field 'Price_old' => nil | ||
field 'Currency' => "'EUR'" | ||
field 'Valid_From' => nil | ||
field 'Valid_To' => nil | ||
field 'DeepLink_URL' => "'https://www.fairmondo.de/articles/' + slug" | ||
field 'Into_Basket_URL' => nil | ||
field 'Image_Small_URL' => "'https://www.fairmondo.de/' + title_image_url(:thumb)" | ||
field 'Image_Small_HEIGHT' => "'200'" | ||
field 'Image_Small_WIDTH' => "'280'" | ||
field 'Image_Large_URL' => "'https://www.fairmondo.de/' + title_image_url(:medium)" | ||
field 'Image_Large_HEIGHT' => nil | ||
field 'Image_Large_WIDTH' => nil | ||
field 'Keywords' => nil | ||
field 'Merchant_Product_Category' => nil | ||
field 'Product_Description_Short' => nil | ||
field 'Product_Description_Long' => 'Sanitize.clean(content)' | ||
field 'Last_Update' => 'updated_at' | ||
field 'Shipping' => nil | ||
field 'Availability' => "'sofort lieferbar'" | ||
field 'Optional_1' => 'id' | ||
field 'Optional_2' => nil | ||
field 'Optional_3' => nil | ||
field 'Optional_4' => nil | ||
field 'Optional_5' => nil | ||
field Merchant_ProductNumber: :slug | ||
field EAN_Code: :gtin | ||
field Product_Title: :title | ||
field Manufacturer: nil | ||
field Brand: nil | ||
field Price: -> { Money.new(self.price_cents).to_s.gsub(',', '.') } | ||
field Price_old: nil | ||
field Currency: 'EUR' | ||
field Valid_From: nil | ||
field Valid_To: nil | ||
field DeepLink_URL: -> { 'https://www.fairmondo.de/articles/' + slug } | ||
field Into_Basket_URL: nil | ||
field Image_Small_URL: -> { 'https://www.fairmondo.de/' + title_image_url(:thumb) } | ||
field Image_Small_HEIGHT: '200' | ||
field Image_Small_WIDTH: '280' | ||
field Image_Large_URL: -> { 'https://www.fairmondo.de/' + title_image_url(:medium) } | ||
field Image_Large_HEIGHT: nil | ||
field Image_Large_WIDTH: nil | ||
field Keywords: nil | ||
field Merchant_Product_Category: nil | ||
field Product_Description_Short: nil | ||
field Product_Description_Long: -> { Sanitize.clean(content) } | ||
field Last_Update: :updated_at | ||
field Shipping: nil | ||
field Availability: 'sofort lieferbar' | ||
field Optional_1: :id | ||
field Optional_2: nil | ||
field Optional_3: nil | ||
field Optional_4: nil | ||
field Optional_5: nil | ||
end | ||
|
||
file_path Rails.env == 'development' ? | ||
destination Rails.env == 'development' ? | ||
"#{ Rails.root }/public/fairmondo_articles.csv" : | ||
'/var/www/fairnopoly/shared/public/system/fairmondo_articles.csv' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters