From f2c0725d79e29b02e30e7a4827851acc4a766730 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Thu, 27 Aug 2009 20:00:14 -0300 Subject: Revert "Add readonly support for relations." This reverts commit 7cce95b25ace33e04526d4490e487a080c1f9b96. --- activerecord/lib/active_record/relation.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'activerecord/lib/active_record/relation.rb') diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 4b53857d36..570ba3f80d 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -5,20 +5,10 @@ module ActiveRecord def initialize(klass, relation) @klass, @relation = klass, relation - @readonly = false - end - - def readonly - @readonly = true - self end def to_a - records = @klass.find_by_sql(@relation.to_sql) - - records.each { |record| record.readonly! } if @readonly - - records + @klass.find_by_sql(@relation.to_sql) end def each(&block) -- cgit v1.2.3