Class: Workarea::Segment::Rules::Tags

Inherits:
Base
  • Object
show all
Includes:
Mongoid::Document::Taggable
Defined in:
app/models/workarea/segment/rules/tags.rb

Instance Method Summary collapse

Methods included from Mongoid::Document::Taggable

included

Methods inherited from Base

slug

Methods included from ApplicationDocument

#releasable?

Methods included from Sidekiq::Callbacks

assert_valid_config!, async, disable, enable, inline, #run_callbacks

Methods included from Mongoid::Document

#embedded_children

Instance Method Details

#qualifies?(visit) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'app/models/workarea/segment/rules/tags.rb', line 7

def qualifies?(visit)
  return false if tags.blank? || visit.metrics.tags.blank?
  (tags & visit.metrics.tags).any?
end