milesj / utility

[Deprecated] A CakePHP plugin for common utility classes.
MIT License
69 stars 24 forks source link

Handle fields using TranslateBehavior and being edited in multiple locales at once #27

Closed redd closed 10 years ago

redd commented 10 years ago

This is bigger Sluggable refactor to support generating slugs while using Cake core's TranslateBehavior and editing record in multiple locales at once with inputs like: Category.name.eng Category.name.deu Category.name.pol

There is only a few changes everything else is only formatting (sorry for that).

What have been changed?

  1. New method _processSlug() that is just pulled out some of logic from beforeSave() callback to not DRY with translated array fields
  2. Totally refactored _makeUnique() because while using TranslateBehavior you can't simply operate on SQL likes because of I18n model. So I decided to work on strings.

That's all, nothing else changed, just I said it's only formatting.

milesj commented 10 years ago

Can you update it and not change the spacing/indenting so that the diff is actually correct?