From f3e651b1f7491f30c05dcce4f4b87e749b856335 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Tue, 28 Apr 2020 16:26:10 +0100 Subject: [PATCH] present? calls length which is breaking it with error ActiveModel::MissingAttributeError Exception: missing attribute: address_id any? works well as it just verifies the size of the collection --- app/models/enterprise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 4c90dae789..0e60be9a14 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -118,7 +118,7 @@ class Enterprise < ActiveRecord::Base except(:select). select('DISTINCT enterprises.id') - if ready_enterprises.present? + if ready_enterprises.any? where("enterprises.id NOT IN (?)", ready_enterprises) else where(nil)