mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
7 lines
237 B
Ruby
7 lines
237 B
Ruby
class SubscriptionGroupValidator < ActiveModel::Validator
|
|
def validate(record)
|
|
if record.user.group != record.plan.group
|
|
record.errors[:plan_id] << "This plan is not compatible with the current user's group"
|
|
end
|
|
end
|
|
end |