Update code style for Enterpise.not_ready_for_checkout

This was changed into multiple lines for readability.
This commit is contained in:
Kristina Lim
2019-05-06 18:37:28 +08:00
parent c0a5bcce92
commit 7593168341

View File

@@ -97,7 +97,11 @@ class Enterprise < ActiveRecord::Base
# When ready_for_checkout is empty, return all rows when there are no enterprises ready for
# checkout.
ready_enterprises = Enterprise.ready_for_checkout
ready_enterprises.present? ? where("id NOT IN (?)", ready_enterprises) : where("TRUE")
if ready_enterprises.present?
where("id NOT IN (?)", ready_enterprises)
else
where("TRUE")
end
}
scope :is_primary_producer, where(:is_primary_producer => true)
scope :is_distributor, where('sells != ?', 'none')