Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-3121

Explicit localization field setting

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      At present (4.0.0 c3da497), I need to do the following to explicitly set localization in a field:

      x = Mymodel.new
      x.attributes['myfield'] = Hash.new
      x.attributes['myfield']['eng'] = 'text string'
      x.attributes['myfield']['deu'] = 'zeichenfolge'

      As a request for enhancement, I would appreciate we could have something more like:

      x = Mymodel.new
      x.myfield_translations[:eng] = 'text string'
      x.myfield_translations[:deu] = 'zeichenfolge'

            Assignee:
            Unassigned Unassigned
            Reporter:
            JoeyLemur JoeyLemur [X]
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: