added constraint for fav search

This commit is contained in:
albert
2011-11-16 13:12:02 -05:00
parent 710d584ec6
commit cce3fe0b64
10 changed files with 4 additions and 96 deletions

View File

@@ -176,7 +176,7 @@ class User < ActiveRecord::Base
module FavoriteMethods
def favorites
Favorite.where("user_id = ?", id).order("id desc")
Favorite.where("user_id % 100 = #{id % 100} and user_id = #{id}").order("id desc")
end
def add_favorite!(post)