Sha256: 32746f6a183bd7376840b159d9620a853d1819e4f9fadbf1855a24150ef6ec71
Contents?: true
Size: 413 Bytes
Versions: 11
Compression:
Stored size: 413 Bytes
Contents
# frozen_string_literal: true 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
11 entries across 11 versions & 3 rubygems