Sha256: 0c8d07412e274d4e12023f54777e676f2965090da4002eb29783ec7f4bac7786

Contents?: true

Size: 635 Bytes

Versions: 118

Compression:

Stored size: 635 Bytes

Contents

# frozen_string_literal: true

# == Schema Information
#
# Table name: gutentag_tags
#
#  id             :integer          not null, primary key
#  name           :string
#  taggings_count :integer          default(0)
#

# Just holds some useful tag methods.
# The original Tag model is Gutentag::Tag
module Alchemy
  class Tag < Gutentag::Tag
    # Replaces tag with new tag on all models tagged with tag.
    def self.replace(tag, new_tag)
      tag.taggings.collect(&:taggable).each do |taggable|
        taggable.tag_list.delete(tag.name)
        taggable.tag_list << new_tag.name
        taggable.save
      end
    end
  end
end

Version data entries

118 entries across 118 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 app/models/alchemy/tag.rb
alchemy_cms-6.1.9 app/models/alchemy/tag.rb
alchemy_cms-6.1.8 app/models/alchemy/tag.rb
alchemy_cms-6.1.7 app/models/alchemy/tag.rb
alchemy_cms-6.1.6 app/models/alchemy/tag.rb
alchemy_cms-6.1.5 app/models/alchemy/tag.rb
alchemy_cms-6.0.14 app/models/alchemy/tag.rb
alchemy_cms-6.1.4 app/models/alchemy/tag.rb
alchemy_cms-7.0.0.pre.a app/models/alchemy/tag.rb
alchemy_cms-6.0.13 app/models/alchemy/tag.rb
alchemy_cms-6.1.3 app/models/alchemy/tag.rb
alchemy_cms-6.1.2 app/models/alchemy/tag.rb
alchemy_cms-6.1.1 app/models/alchemy/tag.rb
alchemy_cms-6.1.0 app/models/alchemy/tag.rb
alchemy_cms-6.0.12 app/models/alchemy/tag.rb
alchemy_cms-6.0.11 app/models/alchemy/tag.rb
alchemy_cms-6.0.10 app/models/alchemy/tag.rb
alchemy_cms-5.3.8 app/models/alchemy/tag.rb
alchemy_cms-6.0.9 app/models/alchemy/tag.rb
alchemy_cms-5.3.7 app/models/alchemy/tag.rb