summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/util.rb')
-rw-r--r--lib/puppet/util.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index bb4127089..f2eaf0d06 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -20,6 +20,14 @@ module Util
# Create a hash to store the different sync objects.
@@syncresources = {}
+ def self.activerecord_version
+ if (defined?(::ActiveRecord) and defined?(::ActiveRecord::VERSION) and defined?(::ActiveRecord::VERSION::MAJOR) and defined?(::ActiveRecord::VERSION::MINOR))
+ ([::ActiveRecord::VERSION::MAJOR, ::ActiveRecord::VERSION::MINOR].join('.').to_f)
+ else
+ 0
+ end
+ end
+
# Return the sync object associated with a given resource.
def self.sync(resource)
@@syncresources[resource] ||= Sync.new