Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (18 sloc) 784 Bytes


This project rocks and uses MIT-LICENSE.

A simple gem for use with mongoid “~> 2.3.3”, that adds attribute readers and writers to any Mongoid document, where a field has been set with :localize => true.


Add to gemfile:

gem "mongoid_localization", :require => "mongoid/localization"

Add to Mongoid document class:

"include Mongoid::Localization"

Now any fields in a mongoid document that has localize set to true will have the following methods available appended with “_translations”


class Post

include Mongoid::Document
include Mongoid::Localization

field :name, :localize => true, :default => ""


The following methods will now be automatically available:

@post.name_translations =