Description:
MERGE changeset 306:307 from branch ytopc08-2 that fixes migration bug
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@308 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r161:edaacd4ec8e9 - - 4 files changed: 13 inserted, 1 deleted
@@ -6,12 +6,15 | |||
|
6 | 6 | :full_name => 'Administrator', |
|
7 | 7 | :alias => 'root') |
|
8 | 8 | root.password = 'ioionrails'; |
|
9 | 9 | |
|
10 | 10 | class << root |
|
11 | 11 | public :encrypt_new_password |
|
12 | + def valid? | |
|
13 | + true | |
|
14 | + end | |
|
12 | 15 | end |
|
13 | 16 | |
|
14 | 17 | root.encrypt_new_password |
|
15 | 18 | |
|
16 | 19 | role = Role.create(:name => 'admin') |
|
17 | 20 | root.roles << role; |
@@ -5,12 +5,19 | |||
|
5 | 5 | default_site.save! |
|
6 | 6 | |
|
7 | 7 | add_column :users, :site_id, :integer |
|
8 | 8 | User.reset_column_information |
|
9 | 9 | |
|
10 | 10 | User.find(:all).each do |user| |
|
11 | + | |
|
12 | + class << user | |
|
13 | + def valid? | |
|
14 | + true | |
|
15 | + end | |
|
16 | + end | |
|
17 | + | |
|
11 | 18 | user.site_id = default_site.id |
|
12 | 19 | user.save |
|
13 | 20 | end |
|
14 | 21 | end |
|
15 | 22 | |
|
16 | 23 | def self.down |
@@ -3,9 +3,9 | |||
|
3 | 3 | add_column :submissions, :source_filename, :string |
|
4 | 4 | add_column :problems, :output_only, :boolean |
|
5 | 5 | end |
|
6 | 6 | |
|
7 | 7 | def self.down |
|
8 | 8 | remove_column :submissions, :source_filename |
|
9 |
- |
|
|
9 | + remove_column :problems, :output_only | |
|
10 | 10 | end |
|
11 | 11 | end |
@@ -1,10 +1,12 | |||
|
1 | 1 | class AddActivatedToUsers < ActiveRecord::Migration |
|
2 | 2 | def self.up |
|
3 | 3 | add_column :users, :activated, :boolean, :default => 0 |
|
4 | 4 | |
|
5 | + User.reset_column_information | |
|
6 | + | |
|
5 | 7 | User.find(:all).each do |user| |
|
6 | 8 | |
|
7 | 9 | # disable validation |
|
8 | 10 | class <<user |
|
9 | 11 | def valid? |
|
10 | 12 | return true |
You need to be logged in to leave comments.
Login now