Last active
August 29, 2015 14:04
-
-
Save ymek/bc945fd3f6f500c0c1a9 to your computer and use it in GitHub Desktop.
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
def cache_key_for_foo | |
cache_key_prefix_from_method | |
end | |
def cache_key_prefix_from_method | |
calling_method = ::Kernel.caller[0][/`.*'/][1..-2] | |
calling_method[14..-1] # length of "cache_key_for_" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment