CodeSleeve / stapler

ORM-based file upload package for php.
http://codesleeve.com
Other
538 stars 144 forks source link

:attachment interpolation & updates to Inflector pluralization #194

Open ccwittwer opened 6 years ago

ccwittwer commented 6 years ago

A consideration for a future update might be to stop using Inflector pluralization on :attachment interpolation when creating the location for files. The Inflector package is routinely getting updates to how certain words are pluralized and when those updates are pulled into a project with Stapler, it can change Stapler's construction of file locations.

For example, a project with an attachment named "audio" was formerly stored in /audios/[id]/[style]/[filename], but in Inflector v1.3, the pluralization for "audio" was changed to "audio" (instead of "audios"), which resulted in Stapler expecting files to be located at /audio/[id]/[style]/[filename]; breaking the connection to those files.

It may be a better approach to interpolate :attachment with the attachment name as specified on the model, rather than pluralizing it. And/or allow for the plural form to be specified on the model.