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