class InfoparkComponentCache::CmsStateGuard

@author Tomasz Przedmojski <tomasz.przedmojski@infopark.de>

@abstract This abstract class enables the implementing classes to access the cms and read the current state.

It also provides the option to limit the object classes used for lookup.

Attributes

obj_root_class[RW]

This parameter should be initialized to the root Obj class of the project

Protected Instance Methods

scoped_relation() click to toggle source

This method implements scoping on the root Obj class and additional constraints for limiting object classes used for lookup

# File lib/infopark_component_cache/guards/cms_state_guard.rb, line 24
def scoped_relation
  conditions = if options[:obj_classes].present?
                 { obj_class: options[:obj_classes] }
               else
                 {}
               end
  CmsStateGuard.obj_root_class.where(conditions)
end