I''ve done this on several projects. Basically, you just create a class
inside the model directory and give it the methods you need. It''s
really that simple. You can even use "include" to add
ActiveRecord''s
validations, if you need them, or take advantage of any other nifty
bits of Ruby code you want. A reasonably simple example that comes to
my mind is SimpleCache, which is used as part of the Typo package. You
can see it''s source at:
http://typo.leetsoft.com/trac.cgi/file/trunk/app/models/simple_cache.rb
For my home grown blogging software, I wrote models that used a CVS
repository as the data store (ala Rublog -- which is what I migrated
from). The code could use some polish, so I''d be loathe to share it
right now, but it''s really not that complicated.
Maybe just start hacking away at it and if you run into a specific
problem, ask the list for help!
Cheers,
Ben
--
http://blog.benschumacher.com/
On 4/19/05, Justin Pietsch
<jpietsch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hello all,
>
> I need to write an application that will use data that is not in an
> SQL database. How reasonable is this to do in rails? I know that
it''s
> /possible/ to create a non-database model, but how hard is it? Does
> anybody have an example of this?
>
> thanks,
>
> Justin
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>