mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 11:14:31 -04:00
Merge pull request #43 from Skud/friendlymembers
missed these migrations. d'oh.
This commit is contained in:
6
db/migrate/20121106101718_add_slug_to_users.rb
Normal file
6
db/migrate/20121106101718_add_slug_to_users.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class AddSlugToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :slug, :string
|
||||
add_index :users, :slug, unique: true
|
||||
end
|
||||
end
|
||||
10
db/migrate/20121106101936_give_old_members_new_slugs.rb
Normal file
10
db/migrate/20121106101936_give_old_members_new_slugs.rb
Normal 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
|
||||
Reference in New Issue
Block a user