I am writing a plugin in Rails 3.2.6 – my plugin is supposed to modify my User model (located in app/models/user.rb) – however, I cannot find the proper way to reference that file from the plugin in a require statement.
I tried require 'user', require 'app/models/user', and a bunch of stuff trying to use Rails.root and other variables – nothing works and I get an error “Uninitialized constant User” when trying to run the app.
Can someone please point me in the right direction? BTW, this plugin was build as a gem and is included in my Gemfile (which pulls it from github).
Thanks!
If you are on ruby 1.9, you should be able to use require_relative
If you are on an older ruby, you might try