controller/app/models/application.rb
##
# Return an array of all of the application overrides defined by the application itself (stored on
# the model or implied by the scalable and ha flags).
#
# By passing "specs" you will retrieve the overrides for the application as if the application were
# changing.
#
# The array returned is a copy of the core data and can be changed without editing the application.
#
Return an array of all of the application overrides defined by the application itself (stored on
the model or implied by the scalable and ha flags).

By passing "specs" you will retrieve the overrides for the application as if the application were
changing.

The array returned is a copy of the core data and can be changed without editing the application.
Return an array of all of the application overrides defined by the application itself ( stored on the model or implied by the scalable and ha flags ) . By passing " specs " you will retrieve the overrides for the application as if the application were changing . The array returned is a copy of the core data and can be changed without editing the application .
def implicit_application_overrides(specs=nil)
    specs ||= component_instances.map(&:to_component_spec)
    overrides = []
    specs.each do |spec|
      spec.cartridge.group_overrides.each do |override|
        if o = GroupOverride.resolve_from(specs, override)
          platforms = o.components.map do |component|
            cart = CartridgeCache.find_cartridge(component.cartridge_name, self)
            unless cart
              cart = specs.map {|s| s.cartridge if s.cartridge.name == component.cartridge_name }.compact.first
            end
            cart ? cart.platform : nil
          end
          if platforms.compact.uniq.size == 1
            overrides << o.implicit
          end
        end
      end
      comp = spec.component
      overrides <<
          if comp.is_sparse?
            GroupOverride.new([spec]).implicit
          elsif spec.cartridge.is_external?
            GroupOverride.new([spec], 0, 0).implicit
          else
            GroupOverride.new([spec], comp.scaling.min, comp.scaling.max).implicit
          end
    end
    if self.scalable
      if self.ha
        overrides.concat(implicit_available_overrides(specs))
      end
    else
      overrides.concat(implicit_non_scalable_overrides(specs))
    end
    overrides
  end
def implicit_application_overrides ( specs = nil ) specs ||= component_instances . map ( & :to_component_spec ) overrides = [ ] specs . each do | spec | spec . cartridge . group_overrides . each do | override | if o = GroupOverride . resolve_from ( specs , override ) platforms = o . components . map do | component | cart = CartridgeCache . find_cartridge ( component . cartridge_name , self ) unless cart cart = specs . map { | s | s . cartridge if s . cartridge . name == component . cartridge_name } . compact . first end cart ? cart . platform : nil end if platforms . compact . uniq . size == 1 overrides << o . implicit end end end comp = spec . component overrides << if comp . is_sparse? GroupOverride . new ( [ spec ] ) . implicit elsif spec . cartridge . is_external? GroupOverride . new ( [ spec ] , 0 , 0 ) . implicit else GroupOverride . new ( [ spec ] , comp . scaling . min , comp . scaling . max ) . implicit end end if self . scalable if self . ha overrides . concat ( implicit_available_overrides ( specs ) ) end else overrides . concat ( implicit_non_scalable_overrides ( specs ) ) end overrides end
Return an array of all of the application overrides defined by the application itself (stored on
the model or implied by the scalable and ha flags).
Return an array of all of the application overrides defined by the application itself ( stored on the model or implied by the scalable and ha flags ) .
# Overrides from the basic cartridge definitions. # Cartridges can contribute overrides # check inside specs for the cartridge object, # since d/l carts are not stored in the application yet # only allow grouping if we're working with a single platform # compact will remove nils from the array, to exclude carts that have not been found # Each component has an implicit override based on its scaling # Overrides that are implicit to applications of this type
specs
<not_specific>