# class Catalog::ActiveRecord

### Public Class Methods

new() click to toggle source
Calls superclass method Puppet::Indirector::ActiveRecord.new

    # File lib/puppet/indirector/catalog/active_record.rb, line 11
    def initialize
      Puppet.deprecation_warning "ActiveRecord-based storeconfigs and inventory are deprecated. See http://links.puppetlabs.com/activerecord-deprecation"
      super
    end

### Public Instance Methods

find(request) click to toggle source

We don’t retrieve catalogs from storeconfigs

    # File lib/puppet/indirector/catalog/active_record.rb, line 17
    def find(request)
      nil
    end

save(request) click to toggle source

Save the values from a Facts instance as the facts on a Rails Host instance.

    # File lib/puppet/indirector/catalog/active_record.rb, line 22
    def save(request)
      catalog = request.instance

      host = ar_model.find_by_name(catalog.name) || ar_model.create(:name => catalog.name)

      host.railsmark "Saved catalog to database" do
        host.merge_resources(catalog.vertices)
        host.last_compile = Time.now

        if node = Puppet::Node.indirection.find(catalog.name)
          host.ip = node.parameters["ipaddress"]
          host.environment = node.environment.to_s
        end

        host.save
      end
    end