Sha256: 51ddf0434beee5042e89e803fbdf25e2825bb2e86765d05e6fcd9193be7a6399

Contents?: true

Size: 447 Bytes

Versions: 196

Compression:

Stored size: 447 Bytes

Contents

# This migration comes from acts_as_taggable_on_engine (originally 3)
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
  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

196 entries across 196 versions & 16 rubygems

Version Path
calagator-1.0.0 spec/dummy/db/migrate/20190419234219_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
fat_free_crm-0.14.2 db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blogit-1.1.2 spec/dummy/db/migrate/20150705003226_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
refinerycms-blog-3.0.2 db/migrate/20140622132538_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
refinerycms-blog-3.0.1 db/migrate/20140622132538_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
fat_free_crm-0.14.1 db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
enju_bookmark-0.2.2 db/migrate/20141013152012_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
enju_bookmark-0.2.1 db/migrate/20141013152012_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
smalruby-editor-0.4.1-x86-mingw32 db/migrate/20150607034015_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
smalruby-editor-0.4.2-x86-mingw32 db/migrate/20150607034015_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
fat_free_crm-0.15.0.beta.2 db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-0.34.1 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-0.34.0 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-0.33.3 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-0.33.2 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-0.33.1 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-0.33.0 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
blacklight-spotlight-0.32.0 db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
fat_free_crm-0.15.0.beta db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
fat_free_crm-0.14.0 db/migrate/20141230205454_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb