I came accross the following problem lately: I got a table with several
BLOB fields (Oracle DB) and I have ActiveRecord reading those fields
whenever records are loaded using finder methods. This behavior is just
fine in 99.9% of the time, but considering BLOB data is not small, it is
considerably slowing down search access :(.
So basically, I thought about building a :has_one relationship and add
an extra table table holding BLOB value so as to cope with the pb. I
found it painfull and not very ‘RoRy’, so I decided to hack
ActiveRecord::Base so as to delay the attribute load… and it works.
Attributes are dynamicaly loaded whenever client application accesses
Syntax looks like the following:
class A < ActiveRecord::Base
delay_attributes :foo, :bar
Now I got two questions:
- as I am new Rails (and Ruby as well): I am wondering if I am missing
something concerning ActiveRecord usage (meaning this hack is useless),
- if this patch is a good idea, I’d like to submit it to the
maintainers of the project, but I don’t know hat is the exact procedure
to do so.