Class: ActsAsTenant::Configuration
- Inherits:
-
Object
- Object
- ActsAsTenant::Configuration
- Defined in:
- lib/acts_as_tenant/configuration.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #job_scope ⇒ Object
-
#job_scope=(scope) ⇒ Object
Used for looking job tenants in background jobs.
Instance Attribute Details
#pkey ⇒ Object
9 10 11 |
# File 'lib/acts_as_tenant/configuration.rb', line 9 def pkey @pkey ||= :id end |
#require_tenant ⇒ Object
5 6 7 |
# File 'lib/acts_as_tenant/configuration.rb', line 5 def require_tenant @require_tenant ||= false end |
Instance Method Details
#job_scope ⇒ Object
13 14 15 |
# File 'lib/acts_as_tenant/configuration.rb', line 13 def job_scope @job_scope || ->(relation) { relation.all } end |
#job_scope=(scope) ⇒ Object
Used for looking job tenants in background jobs
Format matches Rails scopes
job_scope = ->(relation) {}
job_scope = -> {}
23 24 25 26 27 28 29 |
# File 'lib/acts_as_tenant/configuration.rb', line 23 def job_scope=(scope) @job_scope = if scope && scope.arity == 0 proc { instance_exec(&scope) } else scope end end |