fnando/permalink — pull request #5 by azisaka (2012-04-05 20:35:50+00:00)
Title: Mongoid and Mongoid::I18n

Hey @fnando,

during a few tests with your gem and Mongoid + Mongoid::I18n, I went through a few problems with your gem.

First, it declares the field :permalink. It overwrites my translated field. The solution was to remove the field declaration, to avoid the overwritten.

Second, the read_attribute and write_attribute methods are a bit intrusive. I had to use send instead so I can keep the behavior of the permalink= and permalink methods. They are different when using the Mongoid::I18n, since the call of those method is based on the current locale.

I think the changes worth a look :)

Thanks for the work on the gem as well. It helped me a lot.