Hi there I have a rails application that has been deployed with mongrel_cluster. My application contains a model "Cluster.rb" and now I run into namespacing problems when accessing the Cluster class (the Mongrel:Cluster module get''s to try to resolve method calls which leads to a embarrassing NoMethodFound errors) I have started renaming my model, but I wonder what the "safe" way of handling namespace conflicts is. thanks Jens-Christian
On Fri, Sep 08, 2006 at 03:40:25PM +0200, Jens-Christian Fischer wrote:> Hi there > > I have a rails application that has been deployed with > mongrel_cluster. My application contains a model "Cluster.rb" and now > I run into namespacing problems when accessing the Cluster class (the > Mongrel:Cluster module get''s to try to resolve method calls which > leads to a embarrassing NoMethodFound errors) > > I have started renaming my model, but I wonder what the "safe" way of > handling namespace conflicts is.referencing your model class with ::Cluster could work. Jens -- webit! Gesellschaft f?r neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de Schnorrstra?e 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66
Wouldn''t that go find the mongrel one instead? ::Class lookups start at the root of the chain, and mongrel, loading up your application is probably in the front in this case. I am curious about this -- we had a similar conflict with a ferret_index model called Store (store.rb), and ultimately balked and renamed our model. On 9/8/06, Jens Kraemer <kraemer at webit.de> wrote:> On Fri, Sep 08, 2006 at 03:40:25PM +0200, Jens-Christian Fischer wrote: > > Hi there > > > > I have a rails application that has been deployed with > > mongrel_cluster. My application contains a model "Cluster.rb" and now > > I run into namespacing problems when accessing the Cluster class (the > > Mongrel:Cluster module get''s to try to resolve method calls which > > leads to a embarrassing NoMethodFound errors) > > > > I have started renaming my model, but I wonder what the "safe" way of > > handling namespace conflicts is. > > referencing your model class with ::Cluster could work. > > Jens > > -- > webit! Gesellschaft f?r neue Medien mbH www.webit.de > Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de > Schnorrstra?e 76 Tel +49 351 46766 0 > D-01069 Dresden Fax +49 351 46766 66 > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com
On Fri, 2006-09-08 at 11:03 -0400, Charles Brian Quinn wrote:> Wouldn''t that go find the mongrel one instead? > > ::Class lookups start at the root of the chain, and mongrel, loading > up your application is probably in the front in this case. > > I am curious about this -- we had a similar conflict with a > ferret_index model called Store (store.rb), and ultimately balked and > renamed our model.It''s tough because someone has to win. Mongrel tries to stay out of the way, but there''s some stuff that needs to be named certain ways for simplicity. I''m working on a few changes to make it so that the commands are in a Mongrel module, which should simplify things but it''ll involve changing a few of the gem_plugins which I know will piss people off. So for now you''ll have to change your model. Sorry -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.