Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.
Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
Grape's validation runs after a `before` block so we should avoid using
raw params there and instead using `declared(params)` which returns only
the validated whitelisted params, much like a permitted params hash.
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:39: warning: already initialized constant API::V3::Render::RenderAPI::SUPPORTED_CONTEXT_NAMESPACES
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:39: warning: previous definition of SUPPORTED_CONTEXT_NAMESPACES was here
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:40: warning: already initialized constant API::V3::Render::RenderAPI::SUPPORTED_MEDIA_TYPE
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:40: warning: previous definition of SUPPORTED_MEDIA_TYPE was here
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:39: warning: already initialized constant API::V3::Render::RenderAPI::SUPPORTED_CONTEXT_NAMESPACES
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:39: warning: previous definition of SUPPORTED_CONTEXT_NAMESPACES was here
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:40: warning: already initialized constant API::V3::Render::RenderAPI::SUPPORTED_MEDIA_TYPE
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:40: warning: previous definition of SUPPORTED_MEDIA_TYPE was here
apparently using Rails leads to people (like me) not learning how Ruby actually looks up Constants.
We need to provide the prefix whenever the Constant can't be found in our scope or a parent scope.
This is a new try for the APIv3 classes, we either:
- FULLY qualify a class and let the autoloader do the rest
- don't qualify at all, but require the class explicitly
Thus we do not (yet) completely give up on the rails autoloader,
but we circumvent a fair amount of its magic (and problems).
The hope is to eliminate the following problems in development mode:
- NameErrors because the autoloader infers the wrong prefix
- "object is not missing constant" errors occuring more rarely
Let's see how that turns out to work...