Module: ProductExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/models/product_extensions.rb

Instance Method Summary collapse

Instance Method Details

#icecat_article_numberObject

FIXME! HAS 20140413 This is highly customer specific



15
16
17
18
# File 'app/models/product_extensions.rb', line 15

def icecat_article_number
  self.number =~ /^HP-(.+)$/
  $1 || self.number
end

#icecat_product_idObject



25
26
27
# File 'app/models/product_extensions.rb', line 25

def icecat_product_id
  .first.icecat_product_id if .any?
end

#icecat_vendorObject



20
21
22
23
# File 'app/models/product_extensions.rb', line 20

def icecat_vendor
  self.article_number =~ /^HP-(.+)$/
  $1 ? "1" : nil
end