This feels like a newbie question. But, I''m not... I promise... well I
hope.
Lower in this mail I''ve copied in 2 related classes and a module that
extends one of them. This all works fine and calling Image.help
returns "youre screwed" as it should do.
However, if I take out the "include ImageExtension" out of Image and
put it into the child of Image, "ChildImage" (imaginative I know) it
no longer works.. Calling ChildImage.help returns method not defined.
Bah.
I''m totally blaming active record here because it works fine without
it. Ideas anyone?
Cheers
-h
class Image < ActiveRecord::Base
include ImageExtension
end
class ChildImage < Image
end
module ImageExtension
def self.append_features(base)
super
base.extend(ClassMethods)
end
module ClassMethods
def help
"youre screwed"
end
end
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---