Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Creates accessors automatically for Mongoid (~>2.3.3) fields where the fields :localize option has been set to true
branch: master

This branch is 3 commits behind dbkbali:master

Updated the read me

latest commit 119599c4a4
David Krett authored
Failed to load latest commit information.
lib/mongoid Updated read me to add :require to gem file
spec Updated read me to add :require to gem file
.gitignore change in gitignore
.rspec
Gemfile Adds methods to a class to allow access to mongoid translations when …
Gemfile.lock Updated read me to add :require to gem file
MIT-LICENSE initial commit of mongoid localization gem
README.rdoc Updated the read me
Rakefile Adds methods to a class to allow access to mongoid translations when …
mongoid_localization.gemspec got rid of bson_ext dependencies

README.rdoc

MongoidLocalization

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.

Usage:

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”

Example:

class Post

include Mongoid::Document
include Mongoid::Localization

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

end

The following methods will now be automatically available:

@post.name_translations
@post.name_translations =
Something went wrong with that request. Please try again.