mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-10 21:24:20 +01:00
8 lines
255 B
Ruby
8 lines
255 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
|