Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
e4fac8d4
Commit
e4fac8d4
authored
13 years ago
by
Eric Davis
Browse files
Options
Downloads
Patches
Plain Diff
[
#350
] Refactor: extract method
parent
c51a32ac
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/setting.rb
+8
-3
8 additions, 3 deletions
app/models/setting.rb
with
8 additions
and
3 deletions
app/models/setting.rb
+
8
−
3
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
Rails
.
cache
.
delete_matched
(
/^chiliproject\/setting\/.+$/
)
Rails
.
cache
.
write
(
'chiliproject/setting-cleared_on'
,
Marshal
.
dump
(
Time
.
now
))
logger
.
info
'Settings cache cleared.'
if
logger
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
private
# Returns the Setting instance for the setting named name
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment