ruby -w does warn on method redefinitions! On 6/4/08, Donald Ball <donald.ball / gmail.com> wrote: > On Wed, Jun 4, 2008 at 3:20 PM, Leslie Viljoen <leslieviljoen / gmail.com> > wrote: >> Perhaps people don't have this problem very often, but I once spent >> three days puzzling over a Rails app that worked fine on my computer, >> but not at the web host. A library had been installed by the host that >> created a class that was require'd somewhere down the line. That class >> had the same name as one of my models, and it totally killed my app. >> >> Having a dynamic base environment works fine until there's a clash. As >> the code base grows, so do the chances of a clash and also the >> difficulty in finding it. > > I had a similar experience a while back wherein I inadvertently > overrode a method defined by ActiveRecord somewhere. At the time, I > wondered if it might be a good idea to have the ruby interpreter warn > when a method was overridden, unless either the original method was > flagged as silently over-ridable (e..g Object.to_s) or the overriding > method was flagged as intentional (e.g. overriding > ActiveRecord::Base.find). It's almost certainly not worth the hassle > even if the approach is sound, but after spending some hours digging > through the darker corners of the ActiveRecord code, it seemed like an > awfully attractive notion. > > - donald > > -- [we need your code-fu] : www.zadic.co.za