On Sep 3, 3:06 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas-
s.net> wrote:
> To share code between models, you have the same two choices that you
> have for sharing code between *any* classes (remember, there's nothing
> magical about models):
>
> 1. Put it in a module and include it in the models you want to use it,
> or
> 2. Create a subclass of ActiveRecord, put the code there, and have the
> models inherit from that.

or 3, decide that this code deserves to be in a class of its own.

Fred
>
> [...]
>
> > If anyone can point me to a good tutorial on where you put code, I'd
> > be thankful.
>
> You don't need a tutorial here, I think.  You just need to remember that
> inheritance and module inclusion are fundamental Ruby tricks that should
> be on your radar.
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> [email protected]
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to