diff --git a/app/models/circle.rb b/app/models/circle.rb index cb58b97bce..dcb29a91ab 100644 --- a/app/models/circle.rb +++ b/app/models/circle.rb @@ -24,6 +24,6 @@ class Circle < ApplicationRecord validates :title, presence: true validates_each :account_id, on: :create do |record, _attr, value| - record.errors.add(:base, I18n.t('lists.errors.limit')) if List.where(account_id: value).count >= PER_ACCOUNT_LIMIT + record.errors.add(:base, I18n.t('lists.errors.limit')) if Circle.where(account_id: value).count >= PER_ACCOUNT_LIMIT end end