summaryrefslogtreecommitdiffstats
path: root/lib/puppet/rails/resource.rb
diff options
context:
space:
mode:
authorshadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-15 21:10:22 +0000
committershadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-15 21:10:22 +0000
commitf622e18eff86d7a65e47cb6fd3ac07cceb5b3ecb (patch)
tree94c98e6848e2cc419908af1993c63e08089300b3 /lib/puppet/rails/resource.rb
parent9ad62d24093563e947d846fa3771bcebf550b8ee (diff)
downloadpuppet-f622e18eff86d7a65e47cb6fd3ac07cceb5b3ecb.tar.gz
puppet-f622e18eff86d7a65e47cb6fd3ac07cceb5b3ecb.tar.xz
puppet-f622e18eff86d7a65e47cb6fd3ac07cceb5b3ecb.zip
Go back to restype and remove STI classes, they were more trouble than they were worth.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1940 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/rails/resource.rb')
-rw-r--r--lib/puppet/rails/resource.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/puppet/rails/resource.rb b/lib/puppet/rails/resource.rb
index 68a784d9d..423b227ad 100644
--- a/lib/puppet/rails/resource.rb
+++ b/lib/puppet/rails/resource.rb
@@ -10,12 +10,6 @@ class Puppet::Rails::Resource < ActiveRecord::Base
acts_as_taggable
- Puppet::Type.loadall
- Puppet::Type.eachtype do |type|
- klass = Class.new(Puppet::Rails::Resource)
- Object.const_set("Puppet%s" % type.name.to_s.capitalize, klass)
- end
-
def parameters
hash = {}
self.param_values.find(:all).each do |pvalue|
@@ -30,14 +24,14 @@ class Puppet::Rails::Resource < ActiveRecord::Base
# from the configuration.
def to_resource(scope)
hash = self.attributes
- hash.delete("type")
+ hash["type"] = hash["restype"]
+ hash.delete("restype")
hash.delete("host_id")
hash.delete("source_file_id")
hash.delete("id")
hash.each do |p, v|
hash.delete(p) if v.nil?
end
- hash[:type] = self.class.to_s.gsub(/Puppet/,'').downcase
hash[:scope] = scope
hash[:source] = scope.source
obj = Puppet::Parser::Resource.new(hash)