Sean Cribbs wrote:
>
> class << Page
> has_many :widgets
> end
>
> -or- in the `included` method of your module do a class_eval,
>
> def included(base)
> base.class_eval do
> has_many :widgets
> end
> end
>
> You could also use `send` to invoke the has_many method. In other
The first 2 methods don't work at all.
I get
undefined local variable or method `inherit_from_page' for
#<Page:0x23a7f34>
Using the first 2 techniques, where I'm adding a:
belongs_to :inherit_from_page, :class_name => 'Page', :foreign_key
=> 'inherit_from_page_id'
Using the third technique (explicit send calls) It actually "works" for
the first page load, and then fails on subsequent loads.
What I think is really messing things up is rails trying to
automatically load things. I have rails in dev mode, and it reloads
changes to certain files, and not to other files. I havn't been able to
figure it out, but my suspicions is that the way files are loaded at
startup is different from the way they are automatically reloaded.
I've been trying to look through the source attempting to figure out
exactly how extensions are loaded. If someone familliar with the subject
would hop on irc.freenode.net and talk to igotimac about it... I would
greatly appreciate any help.
thanks,
Jacob
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant