Sha256: 69450a56fd85cd422f32bb3df10a5dff2dfa0bc50f0086ff210ecf9b90a475e4

Contents?: true

Size: 376 Bytes

Versions: 25

Compression:

Stored size: 376 Bytes

Contents

class AddFieldsTo<%= table_name.camelize %> < ActiveRecord::Migration
  def self.up
    add_column :<%= table_name %>, :sash_id, :integer
    add_column :<%= table_name %>, :level, :integer, :default => 0
    <%- resource = table_name.singularize -%>
  end

  def self.down
    remove_column :<%= table_name %>, :sash_id
    remove_column :<%= table_name %>, :level
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
merit-1.1.2 lib/generators/active_record/templates/add_fields_to_model.rb
merit-1.1.1 lib/generators/active_record/templates/add_fields_to_model.rb
merit-1.1.0 lib/generators/active_record/templates/add_fields_to_model.rb
merit-1.0.1 lib/generators/active_record/templates/add_fields_to_model.rb
merit-1.0.0 lib/generators/active_record/templates/add_fields_to_model.rb