Sha256: 9c1912dc5d423ccf4c7e2c6b33e9fc42790eb17ecae010c654a5c552756d9e8a

Contents?: true

Size: 470 Bytes

Versions: 2

Compression:

Stored size: 470 Bytes

Contents

class AddAuthenticateToUsers < ActiveRecord::Migration
  def self.up
    change_table :users 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 :users do |t|
<% if config[:new_columns].any? -%>
      t.remove <%= new_columns.keys.map { |column| ":#{column}" }.join(", ") %>
<% end -%>
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authenticate-0.2.1 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb
authenticate-0.2.0 lib/generators/authenticate/install/templates/db/migrate/add_authenticate_to_users.rb