Re: Require in models?

Lee
2007-01-26T19:58:30Z

It seems that a corrupt file (validation.rb) was causing the problem. I
restored to an older version and the problem went away!

I think I need "require" statements for two reasons:

1. to make use of common code under /lib from within my model
2. to access other methods from within a model that "I" have defined
in
other model files

Is this good practice?

On 26 Jan, 19:43, "Jason Roelofs"
<jameskil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> You should almost never need to require anything in your model; Rails
> includes a ton of libraries for you. Odd error though, not exactly sure
what
> it means.
>
> Jason
>
> On 1/26/07, Lee
<lee_longm...-/E1597aS9LT10XsdtD+oqA@public.gmane.org> wrote:
>
>
>
> > I am getting the error "Missing model property.rb" whenever
I insert
> > require statements into my model (in this case property.rb). The error
> > occurs when I try to access my application through the browser. As
soon
> > as I remove the require, the error no longer occurs.
>
> > My code is as follows:
>
> > require ''validation''
> > require ''date''
> > require ''time_period''
> > class Property < ActiveRecord::Base
> > ...
>
> > Thanks.