This project is archived and is in readonly mode.

Changeset [2e79ec71a542c2d2e7bedbe12eda0b5e177fb0e0] by Pratik Naik

December 25th, 2009 @ 08:03 PM

Model.scoped now returns a relation if invoked without any arguments

Example :

posts = Post.scoped
posts.size # Fires "select count(*) from  posts" and returns the count
posts.each {|p| puts p.name } # Fires "select * from posts" and loads post objects

http://github.com/rails/rails/commit/2e79ec71a542c2d2e7bedbe12eda0b...

Committed by Pratik Naik

  • M activerecord/lib/active_record/named_scope.rb
  • M activerecord/test/cases/relations_test.rb

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>