I have a rails module included for reference below that I have included using "require 'model_helper' at the bottom of my environment.rb file.
Everything works fine in development, but when I deploy to my nginx/passenger production environment I get an error that the method acts_as_notifiable defined in my model_helper is not found. For some reason the model_helper is not loaded when starting with passenger. The file is called model_helper.rb and is in the lib folder.
module ActiveRecord
module ModelHelper # module name
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def acts_as_notifiable
after_create :post_create
has_one :notification, :as => :about, :dependent => :destroy
end
end
def post_create
Notification.create :user => user, :about => self unless user.nil?
end
end
end
ActiveRecord::Base.send :include, ActiveRecord::ModelHelper