[Rails] Getting random db entries...
Tobias Luetke
tobias.luetke at gmail.com
Thu Mar 17 01:16:34 GMT 2005
> Now, this will create three Image objects, right? So, if each image
> is 500KB, that's at least a 1.5MB database transfer (right?). I
> really only need each image id.
I store my images in the database too but have a File model which has
a belongs_to :binary
The binaries tables has the actual data, the File table has just the
information about it ( format, mime, imagesize, filename etc )
This lets you use File as normal active record object and only recieve
the blob when needed over the binary relation.
--
Tobi
http://www.snowdevil.ca - Snowboards that don't suck
http://www.hieraki.org - Open source book authoring
http://blog.leetsoft.com - Technical weblog
More information about the Rails
mailing list