#slug should not default to _id.to_s#261
#slug should not default to _id.to_s#261johnnyshields wants to merge 2 commits intomongoid:masterfrom
Conversation
…est of the gem: - _slugs does not contain _id.to_s - clear_slug! sets slugs to [], so #slug will return nil in this case - it will be overwritten when saving - before saving, one would expect both slug and _slugs to be nil
|
Ooooof I know for sure that Artsy relies on the fact that slugs default to ID, and aren't |
|
@dblock we should make this behavior configurable. As noted above, its inconsistent. A "never touched" new model will have slug default to ID, but once you call |
I actually don't think it's inconsistent, but can be misinterpreted. Don't you want to clear the slug on
Sounds good. It should be backwards compatible or we need to bump major and document the breaking change, all while allowing the functionality to exist. |
#slugshould not default to_id.to_s. This is inconsistent with the rest of the gem:_slugsdoes not contain_id.to_sclear_slug!sets_slugsto[], so#slugwill returnnilin this caseslugand_slugsto benil