Sha256: cdb704e2389133b5b5df5ad12ccd747d07c6dbc22763f2481bba66af7e869d2c

Contents?: true

Size: 452 Bytes

Versions: 121

Compression:

Stored size: 452 Bytes

Contents

# This migration comes from acts_as_taggable_on_engine (originally 3)
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2]
  def self.up
    add_column :tags, :taggings_count, :integer, default: 0

    ActsAsTaggableOn::Tag.reset_column_information
    ActsAsTaggableOn::Tag.find_each do |tag|
      ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings)
    end
  end

  def self.down
    remove_column :tags, :taggings_count
  end
end

Version data entries

121 entries across 121 versions & 4 rubygems

Version Path
blacklight-spotlight-3.1.0 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.3 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.2 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.1 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.rc6 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.rc5 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.rc4 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.rc3 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
integral-1.5.1 db/migrate/20160516084704_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
integral-1.5.0 db/migrate/20160516084704_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.rc2 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
refinerycms-blog-4.0.0 db/migrate/20140622132538_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.rc1 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.alpha.10 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
integral-1.4.0 db/migrate/20160516084704_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.alpha.9 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.alpha.8 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.alpha.7 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-3.0.0.alpha.6 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb