diff options
author | Luke Kanies <luke@madstop.com> | 2009-04-23 18:56:30 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-04-25 01:19:51 +1000 |
commit | 8ed7ae3a23dd84dfc7ef835c2bb36f7ee4cfe9e5 (patch) | |
tree | 26099de6846102cf7e35d10e0e388e7302008921 /lib | |
parent | a0c1edec69c7eea70fe1ca9f4e0e1dc6fc3d688b (diff) | |
download | puppet-8ed7ae3a23dd84dfc7ef835c2bb36f7ee4cfe9e5.tar.gz puppet-8ed7ae3a23dd84dfc7ef835c2bb36f7ee4cfe9e5.tar.xz puppet-8ed7ae3a23dd84dfc7ef835c2bb36f7ee4cfe9e5.zip |
Fixing the Rails feature test to require 2.3.x
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r-- | 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 63e6f00bc..561863c9f 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 |