Merge pull request #43 from Skud/friendlymembers

missed these migrations. d'oh.
This commit is contained in:
Skud
2012-11-06 02:44:07 -08:00
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
class AddSlugToUsers < ActiveRecord::Migration
def change
add_column :users, :slug, :string
add_index :users, :slug, unique: true
end
end

View File

@@ -0,0 +1,10 @@
class GiveOldMembersNewSlugs < ActiveRecord::Migration
def up
User.find_each(&:save)
end
# note: this is basically impossible to reverse without removing
# friendly_id, because friendly_id automatically updates the slug when
# you save the object.
end