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
This commit is contained in:
Luis Ramos
2020-04-28 16:26:10 +01:00
parent 7e12142f91
commit f3e651b1f7

View File

@@ -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)