On Thu, Jul 10, 2008 at 9:54 PM, Sean Cribbs <[EMAIL PROTECTED]> wrote:
> Aslak,
>
> That feature does need to be rethought because it's not working as intended.
>  I'd love to see your patch.
>

I just realised this patch had some negative sideeffects. I now get these:

  Expected 
/Users/aslakhellesoy/scm/radiant_ba/vendor/extensions/archive/app/models/archive_page.rb
to define ArchivePage
    
/Users/aslakhellesoy/scm/radiant_ba/vendor/rails/activesupport/lib/active_support/dependencies.rb:249:in
`load_missing_constant'
    
/Users/aslakhellesoy/scm/radiant_ba/vendor/rails/activesupport/lib/active_support/dependencies.rb:453:in
`const_missing'
    
/Users/aslakhellesoy/scm/radiant_ba/vendor/rails/activesupport/lib/active_support/dependencies.rb:465:in
`const_missing'
    
/Users/aslakhellesoy/scm/radiant_ba/vendor/rails/activesupport/lib/active_support/inflector.rb:257:in
`constantize'
    
/Users/aslakhellesoy/scm/radiant_ba/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:148:in
`constantize'
    /Users/aslakhellesoy/scm/radiant_ba/app/models/page.rb:191:in
`load_subclasses'
    /Users/aslakhellesoy/scm/radiant_ba/app/models/page.rb:189:in `each'
    /Users/aslakhellesoy/scm/radiant_ba/app/models/page.rb:189:in
`load_subclasses'
    /Users/aslakhellesoy/scm/radiant_ba/app/models/page.rb:282

The simplest workaround I found was this (#reload_class):

http://github.com/aslakhellesoy/ba/tree/master/ba_extension.rb

I don't have a patch for Radiant though :-/

Aslak

> Sean
>
> aslak hellesoy wrote:
>>
>> I'm working on an extension that defines HappeningPage < Page.
>>
>> At the time where page.rb does a Page.load_subclasses (at the bottom),
>> none of the subclasses are loaded yet. To me it looks like
>> #load_subclasses scans radiant for _page.rb files and constantize the
>> classes, but it doesn't do the same for extensions' page subclasses.
>> As a result, extensions' subclasses get marked as #missing? => false
>>
>> The attached patch fixes this. I'm not 100% sure if I'm right in
>> assuming this is a bug though. If someone can confirm, I'll stick it
>> in Trac.
>>
>> Aslak
>>  ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Radiant mailing list
>> Post:   Radiant@radiantcms.org
>> Search: http://radiantcms.org/mailing-list/search/
>> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to