Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Rails.version on rails 4 #36

Merged
merged 1 commit into from Apr 1, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/rpm_contrib.rb
Expand Up @@ -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 }
Expand All @@ -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