Class: Cats::Core::RoleMenu

Inherits:
ApplicationRecord show all
Defined in:
app/models/cats/core/role_menu.rb

Instance Method Summary collapse

Instance Method Details

#validate_role_and_menuObject



10
11
12
13
14
15
16
# File 'app/models/cats/core/role_menu.rb', line 10

def validate_role_and_menu
  return unless role.present? && menu.present?

  return if role.application_module_id == menu.application_module.id

  errors.add(:base, "Application module does not match for role and menu")
end