search for: product_availability_label

Displaying 1 result from an estimated 1 matches for "product_availability_label".

2006 Nov 29
2
Unexpected behaviour looping an array in a model.
Hi, I''m attempting to loop through an array in a method in a model, Product.rb, and return a value if a certain conditional is met. I''m having some trouble however, as it doesn''t seem to be working as expected. The method from my model is as follows: def product_availability_label QCC.config(:product_availability).each do |av| "#{av.first}" if av.last == self.availability end end The product availability array is declared elsewhere as: config :product_availability, [[''Immediate'',1],[''1 Week'',2],[''2 Weeks...