Class: Gutentag::RemoveUnused

Inherits:
Object
  • Object
show all
Defined in:
lib/gutentag/remove_unused.rb

Class Method Summary collapse

Class Method Details

.callObject



4
5
6
7
8
9
# File 'lib/gutentag/remove_unused.rb', line 4

def self.call
  Gutentag::Tag.connection.execute <<-SQL
DELETE FROM gutentag_tags
WHERE id NOT IN (SELECT DISTINCT tag_id FROM gutentag_taggings)
  SQL
end