Commit 8ac35bfb3c0bff15480d8db83c249f96390ff4f1

Authored by Rodrigo Souto
1 parent 281ae6cc

Skip enterprise activiation if the task has no enterprise

db/migrate/20140318233831_finish_enterprise_activation_for_enabled_enterprises.rb
... ... @@ -2,7 +2,7 @@ class FinishEnterpriseActivationForEnabledEnterprises < ActiveRecord::Migration
2 2 def self.up
3 3 EnterpriseActivation.find_each do |enterprise_activation|
4 4 enterprise = enterprise_activation.enterprise
5   - next unless enterprise.enabled
  5 + next unless enterprise.present? && enterprise.enabled
6 6 enterprise_activation.update_attribute :status, Task::Status::FINISHED
7 7 end
8 8 end
... ...