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-1.10.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.9.2 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.9.1 lib/generators/templates/counter_culture_migration.rb.erb