Commit 120db5fe14031999b36f17b4cd282278b075fca8
1 parent
db63c60a
Exists in
staging
and in
42 other branches
Finish EnterpriseActivation for enabled enterprises
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
db/migrate/20140318233831_finish_enterprise_activation_for_enabled_enterprises.rb
0 → 100644
| @@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
| 1 | +class FinishEnterpriseActivationForEnabledEnterprises < ActiveRecord::Migration | ||
| 2 | + def self.up | ||
| 3 | + EnterpriseActivation.find_each do |enterprise_activation| | ||
| 4 | + enterprise = enterprise_activation.enterprise | ||
| 5 | + next unless enterprise.enabled | ||
| 6 | + enterprise_activation.update_attribute :status, Task::Status::FINISHED | ||
| 7 | + end | ||
| 8 | + end | ||
| 9 | + | ||
| 10 | + def self.down | ||
| 11 | + say "this migration can't be reverted" | ||
| 12 | + end | ||
| 13 | +end |