Sha256: 4615d6a671bd3c21e638e8ef378d4a6839016a27157a6c9174de74ed764b6f3d

Contents?: true

Size: 360 Bytes

Versions: 37

Compression:

Stored size: 360 Bytes

Contents

module RedmineCrm
  module ActsAsTaggable #:nodoc:
    class Tagging < ActiveRecord::Base #:nodoc:
      belongs_to :tag
      belongs_to :taggable, :polymorphic => true

      after_destroy :destroy_tag_if_unused

      private

      def destroy_tag_if_unused
        tag.destroy if Tag.destroy_unused && tag.taggings.count.zero?
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
redmine_crm-0.0.43 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.42 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.41 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.40 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.38 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.37 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.36 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.35 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.34 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.33 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.32 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.31 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.30 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.28 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.27 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.26 lib/redmine_crm/acts_as_taggable/tagging.rb
redmine_crm-0.0.25 lib/redmine_crm/acts_as_taggable/tagging.rb