Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dansbeerlist committed Nov 5, 2013
2 parents 9fd2020 + d25bdab commit d155a90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 0 additions & 3 deletions config/observer_config.json

This file was deleted.

3 changes: 3 additions & 0 deletions config/observer_config.json-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"observers":["cacher","stream_item_cache","conversation_observer"]
}
8 changes: 5 additions & 3 deletions config/shared_boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@
#Empowered: adding converstation observer (if file exists)
#config.active_record.observers = [:cacher, :stream_item_cache]

if File.exist? ('#{RAILS_ROOT}/config/observer_config.json')
include_conversation_observer = JSON.parse(File.open('#{RAILS_ROOT}/config/observer_config.json'))
config.active_record.observers = include_conversation_observer.observers
if File.exist? ("#{RAILS_ROOT}/config/observer_config.json")
include_conversation_observer = JSON.parse(File.read("#{RAILS_ROOT}/config/observer_config.json"))
sym_include_conversation_observer = []
include_conversation_observer["observers"].each {|s| sym_include_conversation_observer.push s.to_sym }
config.active_record.observers = sym_include_conversation_observer
else
config.active_record.observers = [:cacher, :stream_item_cache]
end
Expand Down

0 comments on commit d155a90

Please sign in to comment.