Closed rvsingh closed 8 years ago
Tell me your rails-settings-cached version, and Rails version
2.3.0 :001 > SiteConfig.foo = false
SiteConfig Load (18.6ms) SELECT "settings".* FROM "settings" WHERE (thing_type is NULL and thing_id is NULL) AND "settings"."var" = $1 ORDER BY "settings"."id" ASC LIMIT $2 [["var", "foo"], ["LIMIT", 1]]
(6.3ms) BEGIN
SQL (17.2ms) UPDATE "settings" SET "value" = $1, "updated_at" = $2 WHERE "settings"."id" = $3 [["value", "--- false\n...\n"], ["updated_at", 2016-03-04 15:11:51 UTC], ["id", 16]]
(1.6ms) COMMIT
CACHE: write rails_settings_cached:foo
Dalli::Server#connect 127.0.0.1:11211
=> false
2.3.0 :002 > SiteConfig.foo
CACHE: read rails_settings_cached:foo
=> false
Rails 5.0, rails-settings-cached newest version.
The bug does exist but not when retrieving from the cache.
I have submitted a PR that fixes the bug: https://github.com/huacnlee/rails-settings-cached/pull/97
A boolean setting when set as false gets commited.
But when again fetched in it returns nil.