Module: Releaf::ActionController::Builders

Extended by:
ActiveSupport::Concern
Included in:
Releaf::ActionController
Defined in:
app/lib/releaf/action_controller/builders.rb

Instance Method Summary collapse

Instance Method Details

#application_scopeObject


26
27
28
29
# File 'app/lib/releaf/action_controller/builders.rb', line 26

def application_scope
  scope = Releaf.application.config.mount_location.capitalize
  scope if scope.present? && Releaf::Builders.constant_defined_at_scope?(scope, Object)
end

#builder_class(builder_type) ⇒ Object


22
23
24
# File 'app/lib/releaf/action_controller/builders.rb', line 22

def builder_class(builder_type)
  Releaf::Builders.builder_class(builder_scopes, builder_type)
end

#builder_scopesObject


31
32
33
# File 'app/lib/releaf/action_controller/builders.rb', line 31

def builder_scopes
  [self.class.own_builder_scope, self.class.ancestor_builder_scopes, application_scope].flatten.compact
end