enable i18n for the category custom type
This commit is contained in:
parent
0b27cd5d1b
commit
b89d6f2dbd
@ -9,6 +9,7 @@ require 'locomotive/dragonfly'
|
|||||||
require 'locomotive/liquid'
|
require 'locomotive/liquid'
|
||||||
require 'locomotive/mongoid'
|
require 'locomotive/mongoid'
|
||||||
require 'locomotive/carrierwave'
|
require 'locomotive/carrierwave'
|
||||||
|
require 'locomotive/i18n'
|
||||||
require 'locomotive/custom_fields'
|
require 'locomotive/custom_fields'
|
||||||
require 'locomotive/httparty'
|
require 'locomotive/httparty'
|
||||||
require 'locomotive/inherited_resources'
|
require 'locomotive/inherited_resources'
|
||||||
@ -22,7 +23,6 @@ require 'locomotive/delayed_job'
|
|||||||
require 'locomotive/middlewares'
|
require 'locomotive/middlewares'
|
||||||
require 'locomotive/session_store'
|
require 'locomotive/session_store'
|
||||||
require 'locomotive/hosting'
|
require 'locomotive/hosting'
|
||||||
require 'locomotive/i18n'
|
|
||||||
|
|
||||||
module Locomotive
|
module Locomotive
|
||||||
|
|
||||||
|
@ -23,6 +23,13 @@ module CustomFields
|
|||||||
module Category
|
module Category
|
||||||
class Item
|
class Item
|
||||||
|
|
||||||
|
include Mongoid::I18n
|
||||||
|
|
||||||
|
localized_fields :name, :position
|
||||||
|
|
||||||
|
field :name
|
||||||
|
field :position, :type => Integer, :default => 0
|
||||||
|
|
||||||
def to_liquid
|
def to_liquid
|
||||||
{ 'id' => self._id.to_s, 'name' => self.name }
|
{ 'id' => self._id.to_s, 'name' => self.name }
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user