refs https://github.com/TryGhost/Team/issues/587
- When the 'max' configuration is missing the instance of the class breaks when used unexpectedly. Followed similar approach to currentCountQuery check by failing fast in the constructor
refs https://github.com/TryGhost/Team/issues/587
- Test were missing for class initialization and around how the limit currently works.
- Before extending it's behavior throught its valuable to cover current functionality to not accidentally break anything
refs: https://github.com/TryGhost/Team/issues/510
- Ghost config always uses camelcase. This was incorrectly implemented with snake case originally
- Swap to use camelCase by default, which is desirable, but support both
- It's really easy to support both in the loader and isLimited check, so we do this to stop ourselves tripping on this later
refs: https://github.com/TryGhost/Team/issues/510
- we need to make sure we take into account any invites that could be accepted at any time
- this counts all invites for non-contributor roles as well as all users who aren't contributors
- this should stop there being loop holes to inviting staff users
refs: https://github.com/lodash/lodash/issues/705
- Was seeing unexpected token = errors when using lodash templates in Ghost
- This is because we're setting template settings globally in this dependency and it affects every other user of lodash
- Using runInContext keeps this templateSettings change local to this lib
- Test proves that after requiring limits we can require lodash and have the default values again