From 6f70fb160beb86203de4a580c26d2b4ef819d4b6 Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Mon, 1 Apr 2013 16:00:55 -0400 Subject: [PATCH] Rails.version on rails 4 ref newrelic/rpm#114 --- lib/rpm_contrib.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/rpm_contrib.rb b/lib/rpm_contrib.rb index 79009fc..a24d8a9 100644 --- a/lib/rpm_contrib.rb +++ b/lib/rpm_contrib.rb @@ -14,7 +14,7 @@ module RPMContrib; end if defined? Rails # Rails 3.x+ - if Rails.respond_to?(:version) && Rails.version =~ /^(3|4)/ + if Rails.respond_to?(:version) && Rails.version.to_s =~ /^(3|4)/ module NewRelic class Railtie < Rails::Railtie initializer("rpm_contrib.start_plugin"){ NewRelic::Control.instance.init_plugin } @@ -27,10 +27,9 @@ class Railtie < Rails::Railtie raise "The rpm_contrib gem supports Rails 2.2+ only." end else - # If not running Rails, it is important that you load the contrib gem as late - # as possible so the agent initializes after everything else. Either that + # If not running Rails, it is important that you load the contrib gem as late + # as possible so the agent initializes after everything else. Either that # or make the following call yourself at the end of your startup sequence # (it is idempotent). - NewRelic::Control.instance.init_plugin + NewRelic::Control.instance.init_plugin end -