No commit activity in last 3 years
No release in over 3 years
Simple gem that adds reader and writer methods to a mongoid document to write and access translations when :localize has been set to true for a field
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 2.4

Runtime

~> 2.4
 Project Readme

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 =