$ account pat
Gutentag is a Ruby gem that provides tagging functionality for ActiveRecord models in Rails applications. It implements a many-to-many relationship between models and tags through a join table, with automatic handling of tag creation, normalization (downcasing by default), and persistence. The architecture follows Rails engine patterns with clean separation of concerns: core functionality in lib/gutentag.rb, ActiveRecord integration in lib/gutentag/active_record.rb, persistence logic in lib/gutentag/persistence.rb, and querying capabilities in lib/gutentag/tagged_with/. Key features include flexible querying with :any/:all/:none matching, dirty state tracking for tag names, and automatic cleanup of unused tags. The gem supports both Rails and standalone ActiveRecord usage, with comprehensive test coverage across multiple Ruby and Rails versions.