David A. Black wrote:
> Hi --
> 
> On Mon, 14 Sep 2009, Gaspard Bucher wrote:
> 
>> Example ruby code: http://bit.ly/2NjP5w
> It's a matter of the order of method lookup. In general, an object
> looks for a method first in its class, and then in modules mixed into
> that class.
> 

Damned ! This means that all the dynamic methods created by rails with 
"has_one" and such cannot be overwritten by including a module except if 
you write:

module A
  def self.included(base)
    base.send(:define_method, 'foo') do
      puts "'foo' from A"
    end
  end
end

Any other solution ?

Gaspard
-- 
Posted via http://www.ruby-forum.com/.