Show More
Commit Description:
also shows users in all (without pagination)
Commit Description:
also shows users in all (without pagination)
References:
File last commit:
Show/Diff file:
Action:
db/migrate/20081204122651_add_activated_to_users.rb
| 25 lines
| 430 B
| text/x-ruby
| RubyLexer
|
|
|
r155 | class AddActivatedToUsers < ActiveRecord::Migration | ||
| def self.up | ||||
| add_column :users, :activated, :boolean, :default => 0 | ||||
|
|
r161 | User.reset_column_information | ||
|
|
r155 | User.find(:all).each do |user| | ||
|
|
r159 | |||
| # disable validation | ||||
| class <<user | ||||
| def valid? | ||||
| return true | ||||
| end | ||||
| end | ||||
|
|
r155 | user.activated = true | ||
| user.save | ||||
| end | ||||
| end | ||||
| def self.down | ||||
| remove_column :users, :activated | ||||
| end | ||||
| end | ||||
