diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-02-14 19:28:10 +0100 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-02-15 10:33:11 +1100 |
commit | 24d48e6c07ef634971fcb8ed5b27258db161a018 (patch) | |
tree | 39267cb41544a1d90af1a1eb5d890fd064a2cb3f /lib/puppet/rails | |
parent | 446989b6932e4a2324b9202fa05114046a6fb5df (diff) | |
download | puppet-24d48e6c07ef634971fcb8ed5b27258db161a018.tar.gz puppet-24d48e6c07ef634971fcb8ed5b27258db161a018.tar.xz puppet-24d48e6c07ef634971fcb8ed5b27258db161a018.zip |
Fix #1972 - ActiveRecord fixes resulted in broken tests
Fix #1930 was not complete, with some typos and misuse of
unused code paths in the regular puppetmaster use case.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/rails')
-rw-r--r-- | lib/puppet/rails/resource.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/puppet/rails/resource.rb b/lib/puppet/rails/resource.rb index bd2739d53..c3d287af2 100644 --- a/lib/puppet/rails/resource.rb +++ b/lib/puppet/rails/resource.rb @@ -1,5 +1,6 @@ require 'puppet' require 'puppet/rails/param_name' +require 'puppet/rails/param_value' require 'puppet/rails/puppet_tag' require 'puppet/util/rails/collection_merger' @@ -57,7 +58,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base # returns a hash of param_names.name => [param_values] def get_params_hash(values = nil) - values ||= @params_hash || Puppet::Rails::ParamValues.find_all_params_from_resource(id) + values ||= @params_hash || Puppet::Rails::ParamValue.find_all_params_from_resource(self) if values.size == 0 return {} end @@ -69,7 +70,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base end def get_tag_hash(tags = nil) - tags ||= @tags_hash || Puppet::Rails::ResourceTag.find_all_tags_from_resource(id) + tags ||= @tags_hash || Puppet::Rails::ResourceTag.find_all_tags_from_resource(self) return tags.inject({}) do |hash, tag| # We have to store the tag object, not just the tag name. hash[tag['name']] = tag @@ -99,7 +100,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base result = get_params_hash result.each do |param, value| if value.is_a?(Array) - result[param] = value.collect { |v| v.value } + result[param] = value.collect { |v| v['value'] } else result[param] = value.value end |