Sha256: 44a5e3f9d665763e2fe74bd81d3940fd497cc2a81ff2fa08c173bf420a8c33bb

Contents?: true

Size: 363 Bytes

Versions: 40

Compression:

Stored size: 363 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration

  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

40 entries across 40 versions & 1 rubygems

Version Path
counter_culture-1.8.2 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.8.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.8.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.7.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.6.2 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.6.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.6.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.5.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.5.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.4.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.3.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.3.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.2.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.1.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.1.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-1.0.0 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-0.2.3 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-0.2.2 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-0.2.1 lib/generators/templates/counter_culture_migration.rb.erb
counter_culture-0.2.0 lib/generators/templates/counter_culture_migration.rb.erb