On 12/5/06, M. R.
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> hi everybody
>
> I''ve two models with many lines of duplicated code. Now I want to
> eliminate these duplication. So I create a new module and put the
> duplicated methods into the module.
>
> So, my question is: Where can I save this module? Is /app/models/ the
> right place or how can I save the module in the /lib directory? Perhaps,
> I need the methods in some other models too.
>
> an early reply will oblige
Doesn''t really matter, to tell you the truth. Some people would put
it in the lib dir, because they only keep AR::Base subclasses in the
models dir. I would probably put it in models, because I like to put
all model code (even mixins) in there. lib, to me, is more for
utility classes and extensions. You really can do anything, as long
as it''s in the class path so Ruby can find it.
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---