summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2008-08-13 17:02:35 +0200
committerJames Turnbull <james@lovedthanlost.net>2008-08-17 23:43:10 +1000
commitf48a0ae140661dc14934c0a192c71687929b0624 (patch)
tree8d8c29c61e41e9bc94626915298c1aeed30d7164
parentb1ad596ec0aa3158d70f84d5b1e002f972d3ec71 (diff)
downloadpuppet-f48a0ae140661dc14934c0a192c71687929b0624.tar.gz
puppet-f48a0ae140661dc14934c0a192c71687929b0624.tar.xz
puppet-f48a0ae140661dc14934c0a192c71687929b0624.zip
Fix #1510 - storeconfig fails with rails 2.1
This is a workaround. Since rails seems to have difficulties to map associations to Puppet classes, we explain it carefully what to expect. Changelog
-rw-r--r--CHANGELOG2
-rw-r--r--lib/puppet/rails/resource.rb10
2 files changed, 7 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index f1284aebc..b76d33e22 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
0.24.x
+ Fixed #1510 - Storeconfiguration fixed for Rails 2.1
+
Add the -P/--ping option to puppetrun, fixes #1501
Fixed #1394 - Added stored configuration clearing script to /ext
diff --git a/lib/puppet/rails/resource.rb b/lib/puppet/rails/resource.rb
index 0053dc28d..eabc873df 100644
--- a/lib/puppet/rails/resource.rb
+++ b/lib/puppet/rails/resource.rb
@@ -6,12 +6,12 @@ require 'puppet/util/rails/collection_merger'
class Puppet::Rails::Resource < ActiveRecord::Base
include Puppet::Util::CollectionMerger
- has_many :param_values, :dependent => :destroy
- has_many :param_names, :through => :param_values
+ has_many :param_values, :dependent => :destroy, :class_name => "Puppet::Rails::ParamValue"
+ has_many :param_names, :through => :param_values, :class_name => "Puppet::Rails::ParamName"
+
+ has_many :resource_tags, :dependent => :destroy, :class_name => "Puppet::Rails::ResourceTag"
+ has_many :puppet_tags, :through => :resource_tags, :class_name => "Puppet::Rails::PuppetTag"
- has_many :resource_tags, :dependent => :destroy
- has_many :puppet_tags, :through => :resource_tags
-
belongs_to :source_file
belongs_to :host