Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rails
  3. rails-settings-cached

rails-settings-cached

NOASSERTIONRubyv2.9.6

A Rails gem for managing global application settings with ActiveRecord-like syntax and built-in caching.

GitHubGitHub
1.1k stars203 forks0 contributors

What is rails-settings-cached?

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.

Target Audience

Rails developers who need a robust, performant way to manage application configuration and feature flags without resorting to environment variables or hardcoded values.

Value Proposition

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.

Overview

Global settings for your Rails application.

Use Cases

Best For

  • Storing feature flags or toggle settings in Rails apps
  • Managing application-wide configuration like site name or admin emails
  • Handling user limits, rates, or other numeric settings
  • Storing structured configuration data as arrays or hashes
  • Building admin panels for editing application settings
  • Reducing hardcoded values in Rails initializers or environment files

Not Ideal For

  • Applications requiring per-user or model-specific settings (e.g., user preferences), as the gem focuses on global settings and recommends ActiveRecord serialization for scoped cases
  • Projects where configuration values change very frequently, due to cache invalidation overhead on each update which can degrade performance
  • Non-Rails applications or frameworks, since it's tightly integrated with Rails and ActiveRecord
  • Simple setups where environment variables or Rails credentials are sufficient and don't need the overhead of database-backed settings

Pros & Cons

Pros

Intuitive ActiveRecord-like API

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.

Automatic Caching for Performance

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.

Flexible Data Type Support

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.

Integrated Rails Validations

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.

Organized Scoped Grouping

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.

Cons

Breaking Changes Between Versions

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.

No Built-in Admin Interface

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.

Cache Management Complexity

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.

Not Suitable for Frequent Updates

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.

Frequently Asked Questions

Quick Stats

Stars1,121
Forks203
Contributors0
Open Issues7
Last commit1 year ago
CreatedSince 2011

Tags

#rails#rails-gem#caching#key-value-store#activerecord#config#configuration#ruby-on-rails#configuration-management

Built With

R
Rails
R
Ruby
A
ActiveSupport
A
ActiveRecord

Included in

Rails3.9k
Auto-fetched 5 hours ago

Related Projects

devisedevise

Flexible authentication solution for Rails with Warden.

Stars24,346
Forks5,503
Last commit22 days ago
spreespree

Open-source headless eCommerce platform with REST API, TypeScript SDK, and Next.js storefront for cross-border, B2B or marketplace eCommerce.

Stars15,383
Forks5,257
Last commit1 day ago
activeadminactiveadmin

The administration framework for Ruby on Rails applications.

Stars9,684
Forks3,324
Last commit1 day ago
CarrierwaveCarrierwave

Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks

Stars8,774
Forks1,648
Last commit3 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub