Sha256: 6928b5b39a8ae0c58e17837cec8dcc46d4d07defa869f6adbcd525bda3007e61

Contents?: true

Size: 518 Bytes

Versions: 5

Compression:

Stored size: 518 Bytes

Contents

class AddAuthenticateToUsers < ActiveRecord::Migration<%= migration_version %>
  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

5 entries across 5 versions & 1 rubygems

Version Path
authenticate-0.7.3 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.7.2 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.7.1 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.7.0 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.6.1 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb