mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
c7a59c8cb7
We need to achieve only one process for all booking, not one for subscription, one for reservations, etc. Moreover we must store one object per invoice_item/payment_schedule_object and stop using Invoice.invoiced or PaymentSchedule.scheduled
8 lines
257 B
Ruby
8 lines
257 B
Ruby
class SubscriptionGroupValidator < ActiveModel::Validator
|
|
def validate(record)
|
|
return if record.statistic_profile&.group_id == record.plan&.group_id
|
|
|
|
record.errors[:plan_id] << "This plan is not compatible with the current user's group"
|
|
end
|
|
end
|