diff options
Diffstat (limited to 'lib/puppet/rails/param_name.rb')
-rw-r--r-- | lib/puppet/rails/param_name.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/puppet/rails/param_name.rb b/lib/puppet/rails/param_name.rb index 1b708cacb..1f633638e 100644 --- a/lib/puppet/rails/param_name.rb +++ b/lib/puppet/rails/param_name.rb @@ -4,17 +4,12 @@ require 'puppet/rails/param_value' class Puppet::Rails::ParamName < ActiveRecord::Base include Puppet::Util::CollectionMerger has_many :param_values, :dependent => :destroy -# def <<(value) -# ParamValue.with_scope(:create => {:value => value}) -# end -## end - belongs_to :resource - def to_resourceparam(source) + def to_resourceparam(resource, source) hash = {} hash[:name] = self.name.to_sym hash[:source] = source - hash[:value] = self.param_values.find(:all).collect { |v| v.value } + hash[:value] = resource.param_values.find(:all, :conditions => [ "param_name_id = ?", self]).collect { |v| v.value } if hash[:value].length == 1 hash[:value] = hash[:value].shift end |