lib/active_model/observing.rb in activemodel-3.1.12 vs lib/active_model/observing.rb in activemodel-3.2.0.rc1
- old
+ new
@@ -185,11 +185,10 @@
class << self
# Attaches the observer to the supplied model classes.
def observe(*models)
models.flatten!
models.collect! { |model| model.respond_to?(:to_sym) ? model.to_s.camelize.constantize : model }
- remove_possible_method(:observed_classes)
- define_method(:observed_classes) { models }
+ redefine_method(:observed_classes) { models }
end
# Returns an array of Classes to observe.
#
# You can override this instead of using the +observe+ helper.