From 6b3da4ac899a0a8cf0f05adce4792f7c21786bd9 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 5 Nov 2020 14:01:29 +0000 Subject: [PATCH] Fix "PG::ProtocolViolation: ERROR: bind message supplies 0 parameters" errors --- 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 7d64eccac6..4c7aa40bd8 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -132,7 +132,7 @@ class Enterprise < ActiveRecord::Base where(nil) end } - scope :is_primary_producer, -> { where(is_primary_producer: true) } + scope :is_primary_producer, -> { where("enterprises.is_primary_producer IS TRUE") } scope :is_distributor, -> { where('sells != ?', 'none') } scope :is_hub, -> { where(sells: 'any') } scope :supplying_variant_in, lambda { |variants|