dawarich/app/services/points_limit_exceeded.rb

21 lines
329 B
Ruby
Raw Normal View History

2025-05-16 13:53:42 -04:00
# frozen_string_literal: true
2025-05-16 12:51:48 -04:00
class PointsLimitExceeded
def initialize(user)
@user = user
end
def call
return false if DawarichSettings.self_hosted?
2025-07-16 16:22:33 -04:00
return true if @user.tracked_points.count >= points_limit
2025-05-16 12:51:48 -04:00
false
end
private
def points_limit
DawarichSettings::BASIC_PAID_PLAN_LIMIT
end
end