Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 173
- Log:
Updated to latest release of Beast according to the "getting started with
Beast" guide at:http://beast.caboo.se/forums/1/topics/381
This check-in includes frozen Edge Rails and has the beginnings of
configuration for the ROOL site included.
- Author:
- rool
- Date:
- Fri Mar 02 15:59:12 +0000 2007
- Size:
- 941 Bytes
1 | require 'digest/sha1' |
2 | class AddPasswordHash < ActiveRecord::Migration |
3 | class User < ActiveRecord::Base; end |
4 | def self.up |
5 | # you need to edit your environment.rb and pick a non-default password salt |
6 | # before you continue |
7 | raise "ChangePasswordHash" if PASSWORD_SALT == '48e45be7d489cbb0ab582d26e2168621' |
8 | say_with_time "Hashing all your passwords in 30 seconds... this is a big deal (because it's not reversible), cancel if you aren't ready." do |
9 | sleep 30 |
10 | end |
11 | rename_column :users, :password, :password_hash |
12 | say_with_time "Hashing passwords..." do |
13 | User.find(:all, :select => 'id, password_hash').each do |u| |
14 | u.update_attribute :password_hash, Digest::SHA1.hexdigest(u.password_hash.to_s + PASSWORD_SALT) |
15 | end |
16 | end |
17 | end |
18 | |
19 | def self.down |
20 | raise IrreversibleMigration |
21 | # rename_column :users, :password_hash, :password # the users will have some... interesting passwords now |
22 | end |
23 | end |