spree-contrib / spree_related_products

Related products extension for Spree Commerce.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
149 stars 241 forks source link

Fixes NoMethodError and various updates for Ruby 1.9 #1

Closed citrus closed 13 years ago

citrus commented 13 years ago

Just a quick fix to get this working on 1.9.2.

I kept getting undefined local variable or method 'to_ary' for #<Product:0x0000010655ad28> when trying to use this extension with ruby 1.9. The quick fix is just adds the missing method in the rails engine activate method like so:

def to_ary
  nil
end

I know it's a bit of a hack but it works...

Also, I removed the curly brackets that show up by default in the "Name or SKU" field and added .html_safe to the "Related Products" link in the sidebar.

Cheers,

-Spencer