diff --git a/app/models/subscription_line_item.rb b/app/models/subscription_line_item.rb index 31a9450ea3..1e30f567ad 100644 --- a/app/models/subscription_line_item.rb +++ b/app/models/subscription_line_item.rb @@ -9,6 +9,7 @@ class SubscriptionLineItem < ApplicationRecord validates :quantity, presence: true, numericality: { only_integer: true } default_scope { order('id ASC') } + scope :nil_price_estimate, -> { where(price_estimate: nil) } def total_estimate (price_estimate || 0) * (quantity || 0)