Skip to content

Commit

Permalink
Fixes #6 by parsing values to YAML and then to_ruby.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Mitwicki authored and parndt committed Jul 18, 2012
1 parent 45d4ef7 commit 937b512
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/refinery/setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ class Setting < Refinery::Core::BaseModel

before_save do |setting|
setting.restricted = false if setting.restricted.nil?
if setting.value.present? && setting.value.is_a?(String)
setting.value = YAML.parse(setting.value).to_ruby
end
end

after_save do |setting|
setting.class.rewrite_cache
end

after_destroy do |setting|
setting.class.rewrite_cache
end
Expand Down

0 comments on commit 937b512

Please sign in to comment.