forked from OpenNeo/impress
throw a search error on user:owns when user owns no items
This commit is contained in:
parent
ea7171b322
commit
2f0b0743e8
1 changed files with 6 additions and 0 deletions
|
@ -710,6 +710,12 @@ class Item < ActiveRecord::Base
|
|||
# version of Arel, and other conditions will overwrite this one. Since IDs
|
||||
# are guaranteed to be integers, let's just build our own string condition
|
||||
# and be done with it.
|
||||
|
||||
if item_ids.empty?
|
||||
raise SearchError, "You don't #{ClosetHanger.verb :you, owned_value} " +
|
||||
"any items yet. Head to Your Items to add some!"
|
||||
end
|
||||
|
||||
"id IN (#{item_ids.join(',')})"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue