# Using ActiveRecord with flat files

**URL:** <https://www.ruby-forum.com/t/using-activerecord-with-flat-files/86505>\
**Category:** Rails\
**Created:** [February 22, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/using-activerecord-with-flat-files/86505 "2007-02-22T20:39:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@sebastian](https://www.ruby-forum.com/u/sebastian)\
**Post date:** [February 22, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/using-activerecord-with-flat-files/86505/1 "2007-02-22T20:39:39Z")

</div>

For the application I’m working on I would like to not save the  
uploaded files in the database as I have done previously.  
It seems more “natural” to simply store them in a directory.  
Now I’m thinking that it would be nice to be able to take advantage of  
ActiveRecord anyway - override a couple of methods, so that I can  
define the associations in the customary way and rely on the automatic  
saving features, etc.  
Has anybody done that?  
Which methods would I need to override?  
Or is this not feasible?  
Thanks.  
-Sebastian

---

<div class="post-metadata">

**Author:** ![sebastian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@sebastian](https://www.ruby-forum.com/u/sebastian)\
**Post date:** [February 22, 2007, 8:42pm UTC](https://www.ruby-forum.com/t/using-activerecord-with-flat-files/86505/2 "2007-02-22T20:42:40Z")

</div>

What about using sqlite? I really don’t think modifying AR to use flat  
files is possible. You’d basically have to create your own SQL based  
flat file database then write an adapter for it.

-carl

On 2/22/07, sebastian [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Or is this not feasible?  
> Thanks.  
> -Sebastian
> 
> >

–  
EPA Rating: 3000 Lines of Code / Gallon (of coffee)
