I'm trying to extend AR with a method which needs to be available to
both the class and the instance.
I've tried a gajillion permutations based on examples. I can get the
method added to the Class, but not to instances.
This seems like a logical pattern to me, but it's apparently incorect.
module SpiffyMethods
module MyMethods
def shared_method
return "Hello?"
end
end
def self.included(base)
base.extend ClassMethods # works
base.include InstanceMethods # fails
end
module ClassMethods
include MyMethods
end
module InstanceMethods
include MyMethods
end
end
Need a point in the right direction. Thx.
-- gw
--
Posted via http://www.ruby-forum.com/.
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.