Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
e4fac8d4
Commit
e4fac8d4
authored
May 27, 2011
by
Eric Davis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#350
] Refactor: extract method
parent
c51a32ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
setting.rb
app/models/setting.rb
+8
-3
No files found.
app/models/setting.rb
View file @
e4fac8d4
...
...
@@ -148,11 +148,16 @@ class Setting < ActiveRecord::Base
cache_cleared_on
=
Rails
.
cache
.
read
(
'chiliproject/setting-cleared_on'
)
cache_cleared_on
=
cache_cleared_on
?
Marshal
.
load
(
cache_cleared_on
)
:
Time
.
now
if
settings_updated_on
&&
cache_cleared_on
<=
settings_updated_on
clear_cache
end
end
# Clears all of the Setting caches
def
self
.
clear_cache
Rails
.
cache
.
delete_matched
(
/^chiliproject\/setting\/.+$/
)
Rails
.
cache
.
write
(
'chiliproject/setting-cleared_on'
,
Marshal
.
dump
(
Time
.
now
))
logger
.
info
'Settings cache cleared.'
if
logger
end
end
private
# Returns the Setting instance for the setting named name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment