opf/openproject — pull request #983 by linki (2014-03-04 10:43:09+00:00)
Title: allow storage path to be a lambda

NOTE: on hold, i'm not sure about this atm, discussion welcome

this PR allows setting the Attachment storage path to a lambda in order to evaluate to something dynamic per request, e.g. for added security. doesn't affect the current behaviour.

a contrieved example:

```
Attachment.storage_path = lambda { User.current.admin? ? 'secure' : 'not_secure' }

attachment.disk_filename # => 'somefile.txt'

User.current = some_admin
attachment.diskfile # => '/secure/somefile.txt'

User.current = some_user
attachment.diskfile # => '/not_secure/somefile.txt'
```