mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
19 lines
290 B
Ruby
19 lines
290 B
Ruby
|
|
class PointsLimitExceeded
|
||
|
|
def initialize(user)
|
||
|
|
@user = user
|
||
|
|
end
|
||
|
|
|
||
|
|
def call
|
||
|
|
return false if DawarichSettings.self_hosted?
|
||
|
|
return true if @user.points.count >= points_limit
|
||
|
|
|
||
|
|
false
|
||
|
|
end
|
||
|
|
|
||
|
|
private
|
||
|
|
|
||
|
|
def points_limit
|
||
|
|
DawarichSettings::BASIC_PAID_PLAN_LIMIT
|
||
|
|
end
|
||
|
|
end
|