huacnlee / rails-settings-cached

Global settings for your Rails application.
Other
1.06k stars 202 forks source link

Cache not updated after changing the value? #87

Closed vinzen closed 8 years ago

vinzen commented 8 years ago

Hi, I updated my project from Rails 3.2.x to Rails 4.2.5. One of my unit test failed because there is something wrong with the settings cache.

test "should return 503" do
    puts Setting.amazon_on # it's true
    Setting.amazon_on = false
    puts Setting.amazon_on # it's true
    get :show, {:uid => 'uid', :content => 1} # my controller read true
    assert @response.status == 503
end

I'm using version 0.5.3 (previously 0.2.4)

wvengen commented 8 years ago

I'm having a similar problem when upgrading from 0.4.2 to 0.5.3.

wvengen commented 8 years ago

Looks like a duplicate of #73.

jpbullalayao commented 8 years ago

I believe this is the case for 0.6.2 as well. I use Setting.get_all after changing the value in the DB, and .get_all gives me the old value

hovsater commented 8 years ago

@jpbullalayao I've addressed the issue in #98.