diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-12-28 16:16:21 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-12-28 16:17:46 +0530 |
commit | 02207dc02c10f2b00a84594962d7bf6ffcf539a9 (patch) | |
tree | 562109a2dee894c95eeb40164999a9af88032a5b /activerecord/lib | |
parent | 5156507e13bb17f1852576acfd921a39e06de175 (diff) | |
download | rails-02207dc02c10f2b00a84594962d7bf6ffcf539a9.tar.gz rails-02207dc02c10f2b00a84594962d7bf6ffcf539a9.tar.bz2 rails-02207dc02c10f2b00a84594962d7bf6ffcf539a9.zip |
Add Model.readonly and association_collection#readonly finder method
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index b3a69ab0c0..8bc64a3a93 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -21,7 +21,7 @@ module ActiveRecord construct_sql end - delegate :group, :order, :limit, :joins, :where, :preload, :eager_load, :from, :lock, :to => :scoped + delegate :group, :order, :limit, :joins, :where, :preload, :eager_load, :from, :lock, :readonly, :to => :scoped def select(select = nil, &block) if block_given? diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 30f0207aab..a9b011dd76 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -652,7 +652,7 @@ module ActiveRecord #:nodoc: end end - delegate :select, :group, :order, :limit, :joins, :where, :preload, :eager_load, :from, :lock, :to => :scoped + delegate :select, :group, :order, :limit, :joins, :where, :preload, :eager_load, :from, :lock, :readonly, :to => :scoped # A convenience wrapper for <tt>find(:first, *args)</tt>. You can pass in all the # same arguments to this method as you can to <tt>find(:first)</tt>. diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index ef480cfb29..93f7b74c68 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -1,7 +1,7 @@ module ActiveRecord class Relation delegate :to_sql, :to => :relation - delegate :length, :collect, :map, :each, :to => :to_a + delegate :length, :collect, :map, :each, :all?, :to => :to_a attr_reader :relation, :klass, :associations_to_preload, :eager_load_associations def initialize(klass, relation, readonly = false, preload = [], eager_load = []) |