From 6a81ccd69d96f36f4322ef927191ab5a35e68d68 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 27 Jul 2012 12:01:25 +0100 Subject: ActiveRecord::Base.all returns a Relation. Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway. --- activemodel/lib/active_model/observing.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel') diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb index ca206ee9aa..976dcf23d8 100644 --- a/activemodel/lib/active_model/observing.rb +++ b/activemodel/lib/active_model/observing.rb @@ -215,7 +215,7 @@ module ActiveModel # end # end def observed_classes - Array(observed_class) + [observed_class].compact.flatten end # The class observed by default is inferred from the observer's class name: -- cgit v1.2.3