Module: ActiveRecordPermissions::Permissions
- Defined in:
- lib/active_scaffold/active_record_permissions.rb
Defined Under Namespace
Modules: SecurityMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#existing_record_check? ⇒ Boolean
Because any class-level queries get delegated to the instance level via a new record, it’s useful to know when the authorization query is meant for a specific record or not.
Class Method Details
.included(base) ⇒ Object
64 65 66 67 |
# File 'lib/active_scaffold/active_record_permissions.rb', line 64 def self.included(base) base.extend SecurityMethods base.send :include, SecurityMethods end |
Instance Method Details
#existing_record_check? ⇒ Boolean
Because any class-level queries get delegated to the instance level via a new record, it’s useful to know when the authorization query is meant for a specific record or not. But using new_record? is confusing, even though accurate. So this is basically just a wrapper.
72 73 74 |
# File 'lib/active_scaffold/active_record_permissions.rb', line 72 def existing_record_check? !new_record? end |