Module: TenantCheck::ActiveRecord::CollectionProxyExtension
- Includes:
- TenantSafetyCheck
- Defined in:
- lib/tenant_check/active_record/extensions.rb
Instance Method Summary collapse
Methods included from TenantSafetyCheck
safe_preload, safe_preloading, safe_preloading=
Instance Method Details
#load_target ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/tenant_check/active_record/extensions.rb', line 62 def load_target return super unless ::TenantCheck.enable_and_started? return super if loaded? safe = check_tenant_safety result = TenantSafetyCheck.safe_preload(safe) do super end if safe Array(target).each do |record| record._tenant_check_safe = true end end result end |