summaryrefslogtreecommitdiffstats
path: root/puppet-0.24.8-activerecord-test.patch
blob: fac84739ccbcbe237158fba6c2a1b7d544b8290a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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