Skip to content

Commit

Permalink
fixup! Add TaggableTerms
Browse files Browse the repository at this point in the history
  • Loading branch information
garethrees committed Oct 19, 2023
1 parent d92dc63 commit 3962e7e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/models/concerns/taggable_terms.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
require 'set'

# Apply tags to a Taggable record based on configured attributes matching terms
# mapped to tags get applied when there is a match.
#
# Example:
#
# Record.taggable_terms = { body: { /foo/ => 'foo' } }
# r = Record.new
# r.tagged?('foo')
# # => false
#
# r.update(body: 'foo bar baz')
# r.tagged?('foo')
# # => true
module TaggableTerms
extend ActiveSupport::Concern

Expand Down

0 comments on commit 3962e7e

Please sign in to comment.