From 8d87c80c19b7f0c0966fcfd52e7a6ed99d347a36 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sun, 17 Jan 2010 04:25:59 +0530 Subject: Make Relation#reload force load the records immediately --- activerecord/lib/active_record/relation.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 85bf878416..7c2a080ead 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -124,12 +124,13 @@ module ActiveRecord end def reload - @loaded = false reset + to_a # force reload + self end def reset - @first = @last = @to_sql = @order_clause = @scope_for_create = @arel = nil + @first = @last = @to_sql = @order_clause = @scope_for_create = @arel = @loaded = nil @records = [] self end -- cgit v1.2.3