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.5 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.4 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.3 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.2 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.1 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0rc1 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta10 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta9 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta8 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta7 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta6 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta5 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta4 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta3 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta2 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0beta1 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha15 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha14 app/controllers/umlaut/controller_behavior.rb
umlaut-3.0.0alpha13 app/controllers/umlaut/controller_behavior.rb