A Rails gem for managing global application settings with ActiveRecord-like syntax and built-in caching.
Rails Settings Cached is a Ruby gem that provides a database-backed, cached key-value store for managing global settings in Rails applications. It solves the problem of hardcoding configuration values by allowing developers to store settings like app name, feature flags, or limits in the database and access them with simple, ActiveRecord-like methods.
Rails developers who need a robust, performant way to manage application configuration and feature flags without resorting to environment variables or hardcoded values.
Developers choose Rails Settings Cached for its seamless integration with Rails, automatic caching to avoid performance hits, and intuitive API that feels like using a global hash, making configuration management straightforward and efficient.
Global settings for your Rails application.
Provides a clean, hash-like interface with simple getter and setter methods, as shown in the usage examples where Setting.app_name can be accessed and assigned directly, making it feel familiar to Rails developers.
Built-in caching reduces database queries by storing settings in cache with automatic invalidation on updates, described in the caching flow section, ensuring fast access without manual cache management.
Supports strings, integers, floats, booleans, arrays, hashes, and custom types with serialization, allowing complex configuration like arrays of emails or hashed options, as demonstrated in the type examples.
Enables validations on setting values using Rails' validation system, ensuring data integrity with constraints like presence or inclusion, shown in the validations section where invalid values raise errors.
Allows logical grouping of settings into scopes like :application or :limits via the scope method, making it easier to manage and build admin UIs, as highlighted in the README.
The README warns of significant breaking changes when upgrading from 0.x to 2.x, requiring code adjustments and migration efforts, which can disrupt existing projects.
While it provides an example controller and view, there's no out-of-the-box UI for managing settings; developers must implement their own admin panels, adding development overhead.
Requires manual cache clearing in test environments (e.g., using Setting.clear_cache in teardown) and handling of cache prefixes, which adds complexity to testing and deployment.
Each setting update expires the entire cache, as noted in the caching flow, so if settings change often, it can lead to increased database load and performance issues.
Flexible authentication solution for Rails with Warden.
Open-source headless eCommerce platform with REST API, TypeScript SDK, and Next.js storefront for cross-border, B2B or marketplace eCommerce.
The administration framework for Ruby on Rails applications.
Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.