Added delete of internal cache after create/update/delete.

This commit is contained in:
Martin Edenhofer 2012-04-14 11:57:01 +02:00
parent a59922a831
commit a1a7d38082

View file

@ -3,6 +3,9 @@ class Setting < ActiveRecord::Base
store :state store :state
store :state_initial store :state_initial
before_create :set_initial before_create :set_initial
after_create :delete_cache
after_update :delete_cache
after_destroy :delete_cache
@@config = nil @@config = nil
@ -36,6 +39,9 @@ class Setting < ActiveRecord::Base
end end
private private
def delete_cache
@@config = nil
end
def set_initial def set_initial
self.state_initial = self.state self.state_initial = self.state
end end