Class: ArPermissionRule
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- ArPermissionRule
- Defined in:
- app/models/ar_permission_rule.rb
Overview
Schema information
Table name: ar_permission_rule : Table access permisssion rules
id Integer id
created_at Time created_at
updated_at Time updated_at
ar_role_id Object User role access defined by this rule
Integer Access
ar_permission_rules records define rules for accessing single database table. They define user roles and their permissions to view, create, edit or delete data.
Instance Method Summary collapse
-
#cache_clear ⇒ Object
Clear cache if cache is configured.
-
#validations ⇒ Object
Additional validations.
Instance Method Details
#cache_clear ⇒ Object
Clear cache if cache is configured
52 53 54 |
# File 'app/models/ar_permission_rule.rb', line 52 def cache_clear Agile.cache_clear(:ar_permission) end |
#validations ⇒ Object
Additional validations.
59 60 61 62 63 |
# File 'app/models/ar_permission_rule.rb', line 59 def validations if new_record? && ArPermissionRule.find_by(ar_permission_id: , ar_role_id: ar_role_id).present? errors.add('ar_role_id', I18n.t('agile.already_defined')) end end |