Forum: Ruby on Rails model mixin module madness

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.
DJ Tequila (Guest)
on 2006-05-10 15:08
(Received via mailing list)
If I have several models which exhibit the same functionality, it seems
makes sense to create a mixin, 'include' it in each model and save
myself some work and repeated code.

Where can I define a module which will be available to all models? I
can't seem to find a documented place for them.

Alternatively, is there a Rails-standard way of achieving the effect?

Dan Venkitachalam (Guest)
on 2006-05-13 04:24
(Received via mailing list)
I've done this before by adding the mixin source file to the model
I suspect it would work from lib/ too.


This topic is locked and can not be replied to.