Skip to content

locale_accessors & fallbacks #85

@pwim

Description

@pwim

When using locale_accessors, the locale specific accessors also use the fallbacks. e.g.,

Event.new(title_en: "foo").title_ja 
#=> "foo" instead of nil

I'm using the locale accessors to generate a form that provides the ability to edit an events title in Japanese and English (in two different form fields). With globalize, the locale specific accessors would return nil. This made it obvious which fields have not been translated. It also meant translations only got written when the user entered them. With mobility's current behaviour, if a user edits an event with an untranslated title and then saves it, the untranslated title will become the original title.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions