Skip to content

Commit

Permalink
Fix supplementing tags process
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-hank committed Sep 11, 2019
1 parent 6817097 commit 33b68fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/supplement_tag_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def apply(item_ids = [])
items = scope.taggable_items
end

items = items.tagged_with(tag.name, on: hub.tagging_key)

# TODO: This can be done, but caching would need to be dealt with
#values = items.map { |item| "(#{new_tag.id},#{item.id},'FeedItem',#{self.id},'TagFilter','#{hub.tagging_key}')" }.join(',')
#ActiveRecord::Base.connection.execute("INSERT INTO taggings (tag_id, taggable_id, taggable_type, tagger_id, tagger_type, context) VALUES #{values}")
Expand Down
2 changes: 2 additions & 0 deletions spec/models/supplement_tag_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def filter_list
filter.apply

new_tag_lists = tag_lists_for(@feed_items.reload, @hub.tagging_key)
tag_lists_not_supplemented = @feed_items.reload.last.applied_tags(@hub).pluck(:name)

expect(new_tag_lists).to show_effects_of filter
expect(tag_lists_not_supplemented).not_to include(new_tag_name)
end
end

Expand Down

0 comments on commit 33b68fd

Please sign in to comment.