summaryrefslogtreecommitdiffstats
path: root/lib/puppet/rails
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-13 20:01:12 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-13 20:01:12 +0000
commit637cc71296f96fd1d5f2ca83aa7e20c73757f8dd (patch)
treef3b055bf75d7df6cbabafb24334710071f2ef8ec /lib/puppet/rails
parent9e9ef1acc6231254e52b96257ed1e81475d2d1bc (diff)
I appear to have object collection working, incredibly. This commit does the collection from the database up to adding the objects to the current scope, which is what sends it to the client.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1190 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/rails')
-rw-r--r--lib/puppet/rails/host.rb7
-rw-r--r--lib/puppet/rails/rails_object.rb2
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/puppet/rails/host.rb b/lib/puppet/rails/host.rb
index 3736c407d..65be5294b 100644
--- a/lib/puppet/rails/host.rb
+++ b/lib/puppet/rails/host.rb
@@ -63,13 +63,18 @@ class Puppet::Rails::Host < ActiveRecord::Base
tobj.each do |p,v| params[p] = v end
args = {:ptype => tobj.type, :name => tobj.name}
- [:tags, :file, :line, :collectable].each do |param|
+ [:tags, :file, :line].each do |param|
if val = tobj.send(param)
args[param] = val
end
end
robj = RailsObject.new(args)
+
+ if tobj.collectable
+ robj.toggle(:collectable)
+ end
+
self.rails_objects << robj
robj.addparams(params)
diff --git a/lib/puppet/rails/rails_object.rb b/lib/puppet/rails/rails_object.rb
index 8aa72451b..22d37fca0 100644
--- a/lib/puppet/rails/rails_object.rb
+++ b/lib/puppet/rails/rails_object.rb
@@ -24,7 +24,7 @@ class Puppet::Rails::RailsObject < ActiveRecord::Base
# is collectable, though, since that would cause it to get stripped
# from the configuration.
def to_trans
- obj = Puppet::TransObject.new(name(), ptype())
+ obj = Puppet::TransObject.new(ptype(), name())
[:file, :line, :tags].each do |method|
if val = send(method)