Sha256: b18066b99c1cf9dd4ccfdd29cfefc7483c0b2577750eb26077d844dfb5134439

Contents?: true

Size: 375 Bytes

Versions: 43

Compression:

Stored size: 375 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
  def self.up<% counter_cache_columns.each do |column| %>
    add_column :<%= table_name %>, :<%= column %>, :integer, null: false, default: 0
<% end %>  end

  def self.down<% counter_cache_columns.each do |column| %>
    remove_column :<%= table_name %>, :<%= column %>
<% end %>  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
counter_culture-3.8.2 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.8.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.8.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.7.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.6.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.5.3 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.5.2 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.5.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.5.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.4.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.3.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.3.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.2.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.2.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.1.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-3.0.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-2.9.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-2.8.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-2.7.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-2.6.2 lib/generators/templates/counter_culture_migration.rb.erb