Skip to content

Instantly share code, notes, and snippets.

@seanstickle
Forked from eduardordm/gist:702837
Created November 17, 2010 01:18
Show Gist options
  • Select an option

  • Save seanstickle/702842 to your computer and use it in GitHub Desktop.

Select an option

Save seanstickle/702842 to your computer and use it in GitHub Desktop.
# Trace is a model in vendor/plugins/mylogger/lib/app/models/trace.rb
# vendor/plugins/mylogger/lib/mylogger.rb
#...
module MyLoggerImpl
def self.trace(controller_instance)
puts 'Tracing'
controller_instance.instance_eval do
t = ::Trace.new
t.path = request.url
t.save
end
end
# ...
end
# Error is: uninitialized constant MyLogger::MyLoggerImpl::Trace
# Trace is obviously not in that module. But, how can I use it in my plugin?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment