Permalink
Browse files

Fixed bug where observers were being deleted even in production!!

  • Loading branch information...
aiwilliams committed May 20, 2009
1 parent 41db580 commit 023779b65e58e281634de2e966341dc1af7476e0
Showing with 8 additions and 6 deletions.
  1. +8 −6 rails/init.rb
View
@@ -10,11 +10,13 @@
#
# Should we ever have observers in MList, this will likely need more careful
# attention.
-#
-class << ActiveRecord::Base
- def instantiate_observers_with_mlist_observers
- subclasses.each(&:delete_observers)
- instantiate_observers_without_mlist_observers
+#
+unless Rails.configuration.cache_classes
+ class << ActiveRecord::Base
+ def instantiate_observers_with_mlist_observers
+ subclasses.each(&:delete_observers)
+ instantiate_observers_without_mlist_observers
+ end
+ alias_method_chain :instantiate_observers, :mlist_observers
end
- alias_method_chain :instantiate_observers, :mlist_observers
end

0 comments on commit 023779b

Please sign in to comment.