Skip to content

Default Locale Slug is emptied, when another Locale has the same value #184

Open
@wzowee

Description

When creating a document with a localized title and slug based off of this title, if only the english locale value is set first, and then another locale is set with the same value - the english slug value is removed.

This is very similar to an older issue #153 however the flow that surfaces it is.

page = PageSlugLocalized.create!(title:"Title On English") 
# page["_slugs"] returns {"en" => ["title-on-english"]}

# Switch Locales
I18n.locale = "nl"
page.update_attributes(title:"Title On English")

# page["_slugs"] now returns {"en" => [], "nl" => ["title-on-english"]} 

Some environment versions:
Rails 4.2.0
Ruby 2.1.1p76
mongoid-slug (4.0.0)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions