Skip to content

Instantly share code, notes, and snippets.

@GustavoCaso
Created August 11, 2014 16:30
Show Gist options
  • Save GustavoCaso/69db7478c9cbd68ed9be to your computer and use it in GitHub Desktop.
Save GustavoCaso/69db7478c9cbd68ed9be to your computer and use it in GitHub Desktop.
Question
Write a model (ActiveRecord-based) for storing global configuration settings. It will be used for storing single values, for example an email address to send error emails to, or a flag enable/disable a particular feature. The interface must be simple and convenient, it should be possible to read and write specific configuration items. It must be possible to store values of these 4 types: string, integer, float and boolean. The model should come with a unit test and a migration.
Bonus: add caching within the model so that values are cached in regular Rails cache to minimize db load.
Please include a quick summary of use and commentary regarding any design decisions. Please indicate how long you spent working on this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment