Sha256: 99b27e677d42e3f67155000cd7c618e34f1d46cc2674a82b41e6d754c8afc7ca
Contents?: true
Size: 702 Bytes
Versions: 48
Compression:
Stored size: 702 Bytes
Contents
# This migration comes from acts_as_taggable_on_engine (originally 3) if ActiveRecord.gem_version >= Gem::Version.new('5.0') class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2]; end else class AddTaggingsCounterCacheToTags < ActiveRecord::Migration; end end AddTaggingsCounterCacheToTags.class_eval do def self.up add_column ActsAsTaggableOn.tags_table, :taggings_count, :integer, default: 0 ActsAsTaggableOn::Tag.reset_column_information ActsAsTaggableOn::Tag.find_each do |tag| ActsAsTaggableOn::Tag.reset_counters(tag.id, ActsAsTaggableOn.taggings_table) end end def self.down remove_column ActsAsTaggableOn.tags_table, :taggings_count end end
Version data entries
48 entries across 48 versions & 1 rubygems