uses tag ids instead of tag names

This commit is contained in:
rgarcia
2016-02-17 20:50:37 +01:00
parent f855ad6b3b
commit 9409190db1
2 changed files with 5 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ class Proposal < ActiveRecord::Base
scope :sort_by_relevance , -> { all }
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)}
scope :in_categories, -> { where("tags.name IN (?)", ActsAsTaggableOn::Tag.category_names) }
scope :in_categories, -> { where("tags.id IN (?)", ActsAsTaggableOn::Tag.category_ids) }
def searchable_values
{ title => 'A',