CommonThread - Our Blog

Globalize Hijacked My Country

Written By: Ben Wyrosdick

November 28th, 2007

After installing globalize in my rails app I had several errors because because globalize comes with a model named Country that was conflicting with my Country model that was already in the app. The globalize model is wrapped in a module Globalize so it can be called explicitly if need be, Globalize::Country. But it was also being called when I just tried Country and I could not find a way to get my original model. I tried changing the order of the rails path array to put my app folder first but that made no difference. I looked on several blogs and their solution seem to be to wrap my model in a module too, but that had problems of it own. I went back through the install and realized that part of the install is to put the line “include Globalize” in the environment.rb. That was my problem I removed that then just used the explicit name of the Globalize::Country when I needed it and everything worked fine after that.

Leave a Reply