diff --git a/lib/locomotive.rb b/lib/locomotive.rb index c168db84..bae5f394 100644 --- a/lib/locomotive.rb +++ b/lib/locomotive.rb @@ -9,6 +9,7 @@ require 'locomotive/dragonfly' require 'locomotive/liquid' require 'locomotive/mongoid' require 'locomotive/carrierwave' +require 'locomotive/i18n' require 'locomotive/custom_fields' require 'locomotive/httparty' require 'locomotive/inherited_resources' @@ -22,7 +23,6 @@ require 'locomotive/delayed_job' require 'locomotive/middlewares' require 'locomotive/session_store' require 'locomotive/hosting' -require 'locomotive/i18n' module Locomotive diff --git a/lib/locomotive/custom_fields.rb b/lib/locomotive/custom_fields.rb index 89da81da..c4963e00 100644 --- a/lib/locomotive/custom_fields.rb +++ b/lib/locomotive/custom_fields.rb @@ -23,6 +23,13 @@ module CustomFields module Category class Item + include Mongoid::I18n + + localized_fields :name, :position + + field :name + field :position, :type => Integer, :default => 0 + def to_liquid { 'id' => self._id.to_s, 'name' => self.name } end