Module: Mongoid::Globalize::ActMacro

Defined in:
lib/mongoid_globalize/act_macro.rb

Instance Method Summary collapse

Instance Method Details

#translates(&block) ⇒ Object

Determines translation parameters: fields and options. Available inside block methods are defined in Mongoid::Globalize::FieldsBuilder.

translates do
  field :title
  field :visible, type: Boolean
  fallbacks_for_empty_translations!
end

Param Proc



12
13
14
15
# File 'lib/mongoid_globalize/act_macro.rb', line 12

def translates(&block)
  builder = FieldsBuilder.new(self)
  builder.instance_exec(&block)
end