summaryrefslogtreecommitdiffstats
path: root/lib/puppet/feature/rails.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/feature/rails.rb')
-rw-r--r--lib/puppet/feature/rails.rb5
1 files changed, 4 insertions, 1 deletions
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