Forum: Ruby on Rails where to save a module for model mixin

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
petermichaux (Guest)
on 2005-11-13 22:11
(Received via mailing list)

I have a module with a method I would like to mixin with several models.
Where is the simplest approved location to store this module. I know I
do it with a plugin but this seems like overkill. Also this method in
module interacts with other models so it would not be a stand alone
plugin I
could share with other people.

pergesu (Guest)
on 2005-11-13 22:32
(Received via mailing list)
Throw it in RAILS_ROOT/lib
petermichaux (Guest)
on 2005-11-13 22:56
(Received via mailing list)
Thanks, Pat. Unfortuantely the rails book (p184) implies lib/ is not the
place for this. It says that lib is for code that is not application
specific and that the directory is "vestigial". My code is application
specific and if using lib is deprecated then where else could i put
this. I
suppose I could just keep the module in model/

This topic is locked and can not be replied to.