Created
August 15, 2014 15:28
-
-
Save mikeymicrophone/456e8b5e4c03a5ff2a9c to your computer and use it in GitHub Desktop.
trying to execute __FILE__ on a different file using inheritance and callbacks in Ruby 1.8.7
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 ApplicationController | |
#logs of code omitted | |
before_filter :define_file_locator | |
def define_file_locator | |
self.class.send :define_method, :log_file_location, lambda { | |
instance_eval 'Rails.logger.info "File location: #{__FILE__}"' | |
} | |
log_file_location | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this isn't gonna work. it was kind of a shot in the dark. I wonder if Rubinius would do any better