Comments (2)
你的 I18n.default_locale
来自于 ENV,这个和启动周期有关系,你应该把 default
配置成 lambda 才可以。
field :site_locale, default: -> { I18n.default_locale.to_s }
from rails-settings-cached.
还有一种方式是直接用 Rails.configuration.i18n
取值也可以。
from rails-settings-cached.
Related Issues (20)
- 多个实例,其中一个实例更新数据后,另一个实例直接Setting....请求依然是历史数据 HOT 1
- Extend a model : uninitialized constant RailsSettings::Extend HOT 4
- Use Setting model in application.rb and other environment configs HOT 10
- Can't edit values HOT 1
- Feature: Automatically validate the type when setting a value instead of casting it
- Usage in i18n config files HOT 1
- Readme Typo
- 🚨 in "_table_exists?" the error rescuing is too generic.
- 🚨 fix for "_table_exists?" method HOT 4
- Support for metadata for fields HOT 1
- Default Proc setting does not work if it is readonly
- getting an undefined method for a setting HOT 6
- Unable to use AR scope functionality HOT 3
- Consider document ActiveRecord::Store as another alternative to Scoped Settings
- Disable RequestCache without Rails application HOT 2
- Caching is buggy in Rails 5 HOT 3
- Configurable Cache Expiration HOT 1
- Rails 6.1.6.1 no longer loading Settings in /config/environments/*.rb HOT 1
- Field of Type Hash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails-settings-cached.