hguemar / rpms / puppet

Forked from rpms/puppet 6 years ago
Clone
Blob Blame History Raw
From a7a9fb5afaa58922bb6ecb49e04b5ed59f381d22 Mon Sep 17 00:00:00 2001
From: Luke Kanies <luke@madstop.com>
Date: Thu, 23 Apr 2009 18:56:30 -0500
Subject: [PATCH/puppet] Fixing the Rails feature test to require 2.3.x

Signed-off-by: Luke Kanies <luke@madstop.com>
---
 lib/puppet/feature/rails.rb |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/lib/puppet/feature/rails.rb b/lib/puppet/feature/rails.rb
index 63e6f00..561863c 100644
--- a/lib/puppet/feature/rails.rb
+++ b/lib/puppet/feature/rails.rb
@@ -28,24 +28,11 @@ Puppet.features.add(:rails) do
         end
     end
 
-    # If we couldn't find it the normal way, try using a Gem.
-    unless defined? ActiveRecord
-        begin
-            require 'rubygems'
-            require 'rails'
-        rescue LoadError
-            # Nothing
-        end
+    unless defined?(::ActiveRecord) and ::ActiveRecord::VERSION::MAJOR == 2 and ::ActiveRecord::VERSION::MINOR == 3
+        Puppet.err "ActiveRecord 2.3 required for StoreConfigs"
+        raise "ActiveRecord 2.3 required for StoreConfigs"
     end
 
-    # 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
-        false
-    end
+    true
 end
 
-- 
1.6.4