Sha256: 2d59ed9949153292af50653575a651d5872307b89fa4f9482487992d6c8e8802

Contents?: true

Size: 494 Bytes

Versions: 9

Compression:

Stored size: 494 Bytes

Contents

class AddAuthenticateToUsers < ActiveRecord::Migration
  def self.up
    change_table :<%= table_name %> do |t|
<% config[:new_columns].values.each do |column| -%>
      <%= column %>
<% end -%>
    end

<% config[:new_indexes].values.each do |index| -%>
    <%= index %>
<% end -%>
  end

  def self.down
    change_table :<%= table_name %> do |t|
<% if config[:new_columns].any? -%>
      t.remove <%= new_columns.keys.map { |column| ":#{column}" }.join(", ") %>
<% end -%>
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
authenticate-0.6.0 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.5.0 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.4.0 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.3.3 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.3.2 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.3.1 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.3.0 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.2.3 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.2.2 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb