Forum: Rails Engines development Delaying table attribute load using ActiveRecord

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A28fc032b938f8c5156581bc6d274ba0?d=identicon&s=25 Laurent Lecigne (llecigne)
on 2006-04-01 12:34
Hi all,

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
them explicitely.

Syntax looks like the following:

class A < ActiveRecord::Base
  delay_attributes :foo, :bar
...
end

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 what is the exact procedure
to do so.

Thx
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2006-04-01 13:39
(Received via mailing list)
This post is probably more suitable for the main rails list.

- james

On 4/1/06, Laurent Lecigne <llecigne@free.fr> wrote:
> found it painfull and not very 'RoRy', so I decided to hack
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> engine-developers mailing list
> engine-developers@lists.rails-engines.org
> http://lists.rails-engines.org/listinfo.cgi/engine...
>


--
* J *
  ~
A28fc032b938f8c5156581bc6d274ba0?d=identicon&s=25 Laurent Lecigne (llecigne)
on 2006-04-02 12:20
Done.

Thx

James Adam wrote:
> This post is probably more suitable for the main rails list.
>
> - james
>
> On 4/1/06, Laurent Lecigne <llecigne@free.fr> wrote:
>> found it painfull and not very 'RoRy', so I decided to hack
>>
>>
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>> _______________________________________________
>> engine-developers mailing list
>> engine-developers@lists.rails-engines.org
>> http://lists.rails-engines.org/listinfo.cgi/engine...
>>
>
>
> --
> * J *
>   ~
This topic is locked and can not be replied to.