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
f47821db
Commit
f47821db
authored
Jun 10, 2011
by
Eric Davis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#350
] Remove freeze from Settings so the values can be modified later
parent
ee9b1293
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
setting.rb
app/models/setting.rb
+2
-2
No files found.
app/models/setting.rb
View file @
f47821db
...
...
@@ -96,7 +96,7 @@ class Setting < ActiveRecord::Base
# Returns the value of the setting named name
def
self
.
[]
(
name
)
Marshal
.
load
(
Rails
.
cache
.
fetch
(
"chiliproject/setting/
#{
name
}
"
)
{
Marshal
.
dump
(
find_or_default
(
name
).
value
)})
.
freeze
Marshal
.
load
(
Rails
.
cache
.
fetch
(
"chiliproject/setting/
#{
name
}
"
)
{
Marshal
.
dump
(
find_or_default
(
name
).
value
)})
end
def
self
.
[]=
(
name
,
v
)
...
...
@@ -104,7 +104,7 @@ class Setting < ActiveRecord::Base
setting
.
value
=
(
v
?
v
:
""
)
Rails
.
cache
.
delete
"chiliproject/setting/
#{
name
}
"
setting
.
save
setting
.
value
.
freeze
setting
.
value
end
# Defines getter and setter for each setting
...
...
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