def resources(type, options = {})
      path(type) unless options[:skip_index]
      link_params = options.reject { |k, v| k == :objects }
      get_objects = lambda {
        options[:objects] ? options[:objects].call : type.to_s.classify.constantize
      }
      get_objects.call.find_each(:batch_size => Sitemap.configuration.query_batch_size) do |object|
        path(object, link_params)
      end
    end
def resources(type, options = {})
      path(type) unless options[:skip_index]
      link_params = options.reject { |k, v| k == :objects }
      get_objects = lambda {
        options[:objects] ? options[:objects].call : type.to_s.classify.constantize
      }
      get_objects.call.find_each(:batch_size => Sitemap.configuration.query_batch_size) do |object|
        path(object, link_params)
      end
    end
Adds the associated object types.

 The following will map all Activity entries, as well as the index (<tt>/activities</tt>) page:

   resources :activities

 You can also specify which entries are being mapped:

   resources :articles, :objects => proc { Article.published }

 To skip the index action and map only the records:

   resources :articles, :skip_index => true

 As with the path, you can specify params through the +params+ options hash.
 The params can also be build conditionally by using a +proc+:

   resources :activities, :params => { :host => proc { |activity| [activity.location, host].join(".") } }, :skip_index => true

 In this case the host will change based the each of the objects associated +location+ attribute.
 Because the index page doesn't have this attribute it's best to skip it.