Sooey

2011-01-31 15:05:21 +0900

Mongoid 2.0.0.rc6から2.0.0.rc7での変更点。

色々と変更点はあるのだけど、日本人的に一番大きいのは、Commit eb3f35f84bc73b7346f5189e80b437c2764c1be2 to mongoid's mongoid - GitHubの"mongoid should use :mongoid i18n scope instead of :activemodel"ではないかな。

rc6まではconfig/locales/ja.yml

activemodel:
  attributes:
    user:
      email: "メールアドレス"

という翻訳文字列が定義されていた場合、

I18n.locale = :ja
User.human_attribute_name :email  # => "メールアドレス"

となっていたのですが、rc7からは

mongoid:
  attributes:
    user:
      email: "メールアドレス"

というようにネームスペースの最上部がmongoidのものを見るように変わっています。