aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-08-27 20:00:14 -0300
committerEmilio Tagua <miloops@gmail.com>2009-08-27 20:00:14 -0300
commitf2c0725d79e29b02e30e7a4827851acc4a766730 (patch)
treee1965017c90c55511a80cebe15f8eb21485aaefe /activerecord/lib/active_record/relation.rb
parent7cce95b25ace33e04526d4490e487a080c1f9b96 (diff)
downloadrails-f2c0725d79e29b02e30e7a4827851acc4a766730.tar.gz
rails-f2c0725d79e29b02e30e7a4827851acc4a766730.tar.bz2
rails-f2c0725d79e29b02e30e7a4827851acc4a766730.zip
Revert "Add readonly support for relations."
This reverts commit 7cce95b25ace33e04526d4490e487a080c1f9b96.
Diffstat (limited to 'activerecord/lib/active_record/relation.rb')
-rw-r--r--activerecord/lib/active_record/relation.rb12
1 files changed, 1 insertions, 11 deletions
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)