Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Rails.version must force .to_s after rails 4 #114

Closed
wants to merge 1 commit into from

2 participants

@arthurnn

Rails.version now return a Gem::Version instance. If we want a string
from it, we should call .to_s method. this is also backwards compatible

ref rails/jquery-rails#117
ref rails/rails#8501

@arthurnn arthurnn Rails.version must force to_s after rails 4
Rails.version now return a Gem::Version instance. If we want a string
from it, we should call .to_s method. this is also backwards compatible
[ref rails/rails#8501]
d35dc32
@jasonrclark
Collaborator

Hey @arthurnn thanks for sending that along.

We've already got a fix for this in our private repo, so the next agent release should have this addressed. A few other folks have called it out, so I'll leave this pull request open so hopefully they'll see it, and update when we've got the new version out.

Appreciate the contribution!

@arthurnn

@jasonrclark
great. do you guys have any ETA on that? we have an alpha release planned for this week, and would be nice to have new relic on it.

@arthurnn arthurnn referenced this pull request from a commit in arthurnn/rpm_contrib
@arthurnn arthurnn Rails.version on rails 4 f62c98a
@arthurnn arthurnn referenced this pull request from a commit in arthurnn/rpm_contrib
@arthurnn arthurnn Rails.version on rails 4 6f70fb1
@arthurnn arthurnn referenced this pull request in newrelic/rpm_contrib
Merged

Rails.version on rails 4 #36

@jasonrclark
Collaborator

@arthurnn I don't have an ETA on that, but I can say we didn't have any release plans for this week.

I can check with the team about getting a beta out sooner with these changes if you'd be interested in testing it out.

@arthurnn

@jasonrclark thanks for looking into the issue, but seems like Rails just rollback that Version change, see rails/rails@ceb3b87 so this PR is not necessary anymore. Will be closing it.

Thanks again.

@arthurnn arthurnn closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 1, 2013
  1. @arthurnn

    Rails.version must force to_s after rails 4

    arthurnn authored
    Rails.version now return a Gem::Version instance. If we want a string
    from it, we should call .to_s method. this is also backwards compatible
    [ref rails/rails#8501]
This page is out of date. Refresh to see the latest.
View
4 lib/new_relic/agent/instrumentation/rails3/errors.rb
@@ -24,9 +24,9 @@ def newrelic_notice_error(exception, custom_params = {})
DependencyDetection.defer do
@name = :rails3_error
-
+
depends_on do
- defined?(::Rails) && ::Rails.respond_to?(:version) && ::Rails.version.to_i == 3
+ defined?(::Rails) && ::Rails.respond_to?(:version) && ::Rails.version.to_s.to_i == 3
end
depends_on do
View
4 lib/new_relic/agent/instrumentation/rails4/errors.rb
@@ -24,9 +24,9 @@ def newrelic_notice_error(exception, custom_params = {})
DependencyDetection.defer do
@name = :rails4_error
-
+
depends_on do
- defined?(::Rails) && ::Rails.respond_to?(:version) && ::Rails.version.to_i == 4
+ defined?(::Rails) && ::Rails.respond_to?(:version) && ::Rails.version.to_s.to_i == 4
end
depends_on do
View
2  lib/newrelic_rpm.rb
@@ -32,7 +32,7 @@ def self.run
end
end
elsif defined? Rails
- if Rails.respond_to?(:version) && Rails.version > '3'
+ if Rails.respond_to?(:version) && Rails.version.to_s > '3'
module NewRelic
class Railtie < Rails::Railtie
Something went wrong with that request. Please try again.