From 42b78a0689b1a8b108140f5e031ae2ef18a337a2 Mon Sep 17 00:00:00 2001 From: mpalmer Date: Mon, 15 Jan 2007 23:07:52 +0000 Subject: Use a specific ActiveRecord subclass to check for the proper existence of AR in the Rails feature test, so that we don't kill everything if the machine has Rails installed, but it's an old version that doesn't support polymorphic associations git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2071 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/feature/rails.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/feature/rails.rb b/lib/puppet/feature/rails.rb index 7fe4e327e..238ac2802 100644 --- a/lib/puppet/feature/rails.rb +++ b/lib/puppet/feature/rails.rb @@ -34,7 +34,10 @@ Puppet.features.add(:rails) do end end - if defined? ActiveRecord + # We check a fairly specific class, so that we can be sure that we've + # loaded a new enough version of AR that will support the features we + # actually use. + if defined? ActiveRecord::Associations::BelongsToPolymorphicAssociation require 'puppet/rails' true else -- cgit