Commit f927bc53e2efdb1856ede81a8b6ee6a2c359ac13
1 parent
f19bb31e
Exists in
master
and in
29 other branches
ActionItem25: indexing product category name for products
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1039 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
app/models/product.rb
| @@ -10,8 +10,12 @@ class Product < ActiveRecord::Base | @@ -10,8 +10,12 @@ class Product < ActiveRecord::Base | ||
| 10 | 10 | ||
| 11 | after_update :save_image | 11 | after_update :save_image |
| 12 | 12 | ||
| 13 | - acts_as_searchable :fields => [:name, :description] | 13 | + acts_as_searchable :fields => [ :name, :description, :category_name ] |
| 14 | 14 | ||
| 15 | + def category_name | ||
| 16 | + product_category.name | ||
| 17 | + end | ||
| 18 | + | ||
| 15 | def image_builder=(img) | 19 | def image_builder=(img) |
| 16 | if image && image.id == img[:id] | 20 | if image && image.id == img[:id] |
| 17 | image.attributes = img | 21 | image.attributes = img |