Commit 8ac35bfb3c0bff15480d8db83c249f96390ff4f1
1 parent
281ae6cc
Exists in
master
and in
22 other branches
Skip enterprise activiation if the task has no enterprise
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
db/migrate/20140318233831_finish_enterprise_activation_for_enabled_enterprises.rb
@@ -2,7 +2,7 @@ class FinishEnterpriseActivationForEnabledEnterprises < ActiveRecord::Migration | @@ -2,7 +2,7 @@ class FinishEnterpriseActivationForEnabledEnterprises < ActiveRecord::Migration | ||
2 | def self.up | 2 | def self.up |
3 | EnterpriseActivation.find_each do |enterprise_activation| | 3 | EnterpriseActivation.find_each do |enterprise_activation| |
4 | enterprise = enterprise_activation.enterprise | 4 | enterprise = enterprise_activation.enterprise |
5 | - next unless enterprise.enabled | 5 | + next unless enterprise.present? && enterprise.enabled |
6 | enterprise_activation.update_attribute :status, Task::Status::FINISHED | 6 | enterprise_activation.update_attribute :status, Task::Status::FINISHED |
7 | end | 7 | end |
8 | end | 8 | end |