Module: TenantCheck::ActiveRecord::TenantSafetyCheck
- Included in:
- CollectionProxyCheck, RelationCheck
- Defined in:
- lib/tenant_check/active_record/extensions.rb
Class Method Summary collapse
- .internal_force_safe(safe) ⇒ Object
- .internal_force_safe_scope=(value) ⇒ Object
- .internal_force_safe_scope? ⇒ Boolean
Class Method Details
.internal_force_safe(safe) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/tenant_check/active_record/extensions.rb', line 25 def internal_force_safe(safe) # rubocop:disable Style/ParallelAssignment prev, self.internal_force_safe_scope = internal_force_safe_scope?, true if safe # rubocop:enable Style/ParallelAssignment yield ensure self.internal_force_safe_scope = prev if safe end |
.internal_force_safe_scope=(value) ⇒ Object
21 22 23 |
# File 'lib/tenant_check/active_record/extensions.rb', line 21 def internal_force_safe_scope=(value) Thread.current[:tenant_check_internal_force_safe_scope] = value end |
.internal_force_safe_scope? ⇒ Boolean
17 18 19 |
# File 'lib/tenant_check/active_record/extensions.rb', line 17 def internal_force_safe_scope? Thread.current[:tenant_check_internal_force_safe_scope] end |