From f927bc53e2efdb1856ede81a8b6ee6a2c359ac13 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Sun, 2 Dec 2007 00:54:09 +0000 Subject: [PATCH] ActionItem25: indexing product category name for products --- app/models/product.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/product.rb b/app/models/product.rb index ebbbc0d..377595b 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -10,8 +10,12 @@ class Product < ActiveRecord::Base after_update :save_image - acts_as_searchable :fields => [:name, :description] + acts_as_searchable :fields => [ :name, :description, :category_name ] + def category_name + product_category.name + end + def image_builder=(img) if image && image.id == img[:id] image.attributes = img -- libgit2 0.21.2