Permalink
Browse files
Fixed bug where observers were being deleted even in production!!
- Loading branch information...
Showing
with
8 additions
and
6 deletions.
-
+8
−6
rails/init.rb
|
@@ -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