diff options
author | David Gay <david@davidgay.org> | 2021-06-06 00:20:33 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-06 00:23:46 -0400 |
commit | 282c27edf741a36ec5bb659ab57bafa4e7a3eb9a (patch) | |
tree | e16499fa65d67bc3ed0503f4408b7958a1fd5317 /app/models | |
parent | afdea263109d0af8b4c676b5bddaad8ee6ac40ab (diff) |
New inventory view, with items sorted by categories
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/concerns/has_whatnot.rb | 7 |
1 files changed, 6 insertions, 1 deletions
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) |