Sha256: a71084512a96a6666f64a25bde9be10c6be5e7332852999a5193039428cdba67

Contents?: true

Size: 1.15 KB

Versions: 30

Compression:

Stored size: 1.15 KB

Contents

# All behavior from UmlautController is extracted into this module,
# so that we can generate a local UmlautController that includes
# this module, and local app can configure or over-ride default behavior. 
# 
module Umlaut::ControllerBehavior
  extend ActiveSupport::Concern
  
  include UmlautConfigurable
  include Umlaut::ErrorHandling
  include Umlaut::ControllerLogic
  
  included do |controller|
    controller.helper Umlaut::Helper # global umlaut view helpers
    
    # init default configuration values
    UmlautConfigurable.set_default_configuration!(controller.umlaut_config)
  end
  
  protected
  
  # Returns a Collection object with currently configured services. 
  # Loads from Rails.root/config/umlaut_services.yml
  #
  # Local app can in theory override in local UmlautController to have
  # different custom behavior for calculating the collection, but this
  # is not entirely tested yet. 
  def create_collection    
    # trim out ones with disabled:true
    services = ServiceStore.config["default"]["services"].reject {|id, hash| hash && hash["disabled"] == true}
            
    return Collection.new(@user_request, services)
  end
  
  
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
umlaut-3.0.0alpha12 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha11 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha10 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha9 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha8 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha7 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha6 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha5 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha4 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha3 app/controllers/umlaut/controller_behavior.rb