Skip to content

Commit 2969b02

Browse files
authored
Fix cache read twice for a single value (#257)
1 parent bd556b0 commit 2969b02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rails-settings/fields/base.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def default_value
3333
end
3434

3535
def read
36-
return deserialize(default_value) if readonly || saved_value.nil?
37-
38-
deserialize(saved_value)
36+
stored_value = saved_value
37+
return deserialize(default_value) if readonly || stored_value.nil?
38+
deserialize(stored_value)
3939
end
4040

4141
def deserialize(value)

0 commit comments

Comments
 (0)