lib/loaders/spree/product_loader.rb
# Options
#
#  :reload           : Force load of the method dictionary for object_class even if already loaded
#  :verbose          : Verbose logging and to STDOUT
#
Options
:reload           : Force load of the method dictionary for object_class even if already loaded
:verbose          : Verbose logging and to STDOUT
Options : reload : Force load of the method dictionary for object_class even if already loaded : verbose : Verbose logging and to STDOUT
def add_additional_prices current_method_detail
        chain_list = get_each_assoc  
        chain_list.each do |money|
            if current_method_detail.name=="price_eu"
              price= Spree::Price.find_or_create_by(:variant_id => @load_object.master.id,:currency=>"EUR" )
              price.amount= money.to_d.round(2)
              price.save
            else
              price= Spree::Price.find_or_create_by(:variant_id => @load_object.master.id,:currency=>"RUB" )
              price.amount= money.to_d.round(2)
              price.save
            end
        end
      end
def add_additional_prices current_method_detail chain_list = get_each_assoc chain_list . each do | money | if current_method_detail . name == "price_eu" price = Spree :: Price . find_or_create_by ( :variant_id => @load_object . master . id , :currency => "EUR" ) price . amount = money . to_d . round ( 2 ) price . save else price = Spree :: Price . find_or_create_by ( :variant_id => @load_object . master . id , :currency => "RUB" ) price . amount = money . to_d . round ( 2 ) price . save end end end
Options
:reload           : Force load of the method dictionary for object_class even if already loaded
:verbose          : Verbose logging and to STDOUT
Options : reload : Force load of the method dictionary for object_class even if already loaded : verbose : Verbose logging and to STDOUT
# potentially multiple chains in single column (delimited by Delimiters::multi_assoc_delim)
current_method_detail