Is there a guide to monkey patching Radiant out there somewhere? I Googled
around but didn't find anything, so I tried the serendipitous approach:

    % script/generate extension absolute_urls

I then created app/models/page.rb (the hack in the old Radiant site I'm
upgrading was made to Radiant's app/models/page.rb), which looks like this:

class Page < ActiveRecord::Base
  module AbsoluteURLHack
    def url
      # If the slug begins with a slash, then it is an absolute url.  Do
      # not build up the url using the parent's url.
      if parent? && !(slug =~ /^\//)

  include AbsoluteURLHack

I didn't touch any of the other files that script/generate created for me.

When I run script/server, I'm now seeing something really strange--this
extension doesn't fail, but one of my other extensions does (it works when I
remove this new extension):

=> Booting Mongrel
=> Rails 2.3.4 application starting on
Could not load extension from file: static_publisher_extension.
#<NoMethodError: undefined method `description' for #<Class:0xb7e28dc8>>
`load_missing_constant': Object is not missing constant
ArchiveYearIndexPage! (ArgumentError)

Aside from the really bizarre wording of that last line ("object is
*not* missing
constant"????), I don't understand what's going wrong. Could someone help me
with this? If there's a doc that will alleviate me of my ignorance, by all
means, point me at it.



Reply via email to