Module: RailsMultitenant::GlobalContextRegistry::RegistryDependentOn

Included in:
Current::ClassMethods, CurrentInstance::ClassMethods
Defined in:
lib/rails_multitenant/global_context_registry/registry_dependent_on.rb

Instance Method Summary collapse

Instance Method Details

#global_context_dependent_on(*klasses) ⇒ Object

Is this class dependent on changes in another GlobalContextRegistry- stored object? Register that dependency here.



8
9
10
# File 'lib/rails_multitenant/global_context_registry/registry_dependent_on.rb', line 8

def global_context_dependent_on(*klasses)
  klasses.each { |klass| GlobalContextRegistry.send(:add_dependency, klass, self) }
end

#global_context_mutually_dependent_on(*klasses) ⇒ Object

Registers a bi-directional dependency on another class.



13
14
15
16
# File 'lib/rails_multitenant/global_context_registry/registry_dependent_on.rb', line 13

def global_context_mutually_dependent_on(*klasses)
  global_context_dependent_on(*klasses)
  klasses.each { |klass| klass.global_context_dependent_on(self) }
end