Hum... Haven't thought of that. Thanks.

Still, this is not the expected behaviour for a ruby class right? Or am I 
completly wrong here?
On Sep 28, 2012, at 12:02 PM, Robert Pankowecki wrote:

> Probably because of the way how Rails is looking for constants ? I would 
> guess that it does not read the file from engine at all, and just reads the 
> file from your app.
> 
> Robert Pankowecki
> http://robert.pankowecki.pl
> 
> On Fri, Sep 28, 2012 at 12:59 PM, Luís Ferreira <zamith...@gmail.com> wrote:
> Hey guys,
> 
> I've been working on engines lately and I can't understand why a class in an 
> engine can't be monkey patched. Here's an example:
> 
> In the engine:
> 
> class MyEngine::MyController < ApplicationController
>   def index
>     @stuff = 1
>   end
> 
>   def show
>     ... something happens ...
>   end
> end
> 
> In the app including the engine:
> 
> class MyEngine::MyController < ApplicationController
>   def index
>     @stuff = 2
>   end
> end
> 
> In this example I would expect for only the index method to be overriden, but 
> it seems the entire class is overriden. Is there any reason for this 
> behaviour? Is this a feature or a bug?
> 
> 
> Regards,
> Luís Ferreira
> 
> 
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-core+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-core?hl=en.
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-core+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-core?hl=en.

Cumprimentos,
Luís Ferreira



-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to