Module: Polytag::Concerns::Taggable::ClassHelpers
- Included in:
- ClassMethods
- Defined in:
- lib/polytag/concerns/taggable/class_helpers.rb
Instance Method Summary collapse
Instance Method Details
#has_tag(tag, args = {}) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/polytag/concerns/taggable/class_helpers.rb', line 5 def has_tag(tag, args = {}) query = ::Polytag.get tag: tag, tag_group: args[:tag_group], owner: args[:tag_group_owner], foc: nil includes(:tags).where(polytag_connections: {polytag_tag_id: query.select(:id)}) end |