Created
July 10, 2009 06:31
-
-
Save benders/144279 to your computer and use it in GitHub Desktop.
Use New Relic add_method_tracer with Class methods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product < ActiveRecord::Base | |
class << self | |
# Define a public instance method on the singleton Class named Product | |
def get_recommended_for_subscriber(subscriber) | |
# ... call some web service, then use find to return a product instance ... | |
end | |
add_method_tracer :get_recommended_for_subscriber, 'Custom/Product.get_recommended_for_subscriber' | |
end | |
# Instance methods of Product go here | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment