From 282c27edf741a36ec5bb659ab57bafa4e7a3eb9a Mon Sep 17 00:00:00 2001 From: David Gay Date: Sun, 6 Jun 2021 00:20:33 -0400 Subject: New inventory view, with items sorted by categories --- app/models/concerns/has_whatnot.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/models/concerns') diff --git a/app/models/concerns/has_whatnot.rb b/app/models/concerns/has_whatnot.rb index a0934ef..22322c0 100644 --- a/app/models/concerns/has_whatnot.rb +++ b/app/models/concerns/has_whatnot.rb @@ -7,7 +7,12 @@ module HasWhatnot end def tags - whatnot[:tags] ? whatnot[:tags] : [] + whatnot && whatnot[:tags] ? whatnot[:tags] : [] + end + + def has_tag?(tag) + return false unless tags.any? + tags.include?(tag) end def where_has_tag(tag) -- cgit v1.2.3