diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-07-27 18:08:18 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-07-27 18:08:18 +0100 |
commit | 3205c768b7c592e5b96fdf6a6dd0fd3c2c9e5775 (patch) | |
tree | 631aebab77a934df61ecfef4c9aaea3d69825eeb /activerecord/lib/active_record/relation/query_methods.rb | |
parent | d1099540aff6cf00f31dafbbceed1f9fc48780a2 (diff) | |
download | rails-3205c768b7c592e5b96fdf6a6dd0fd3c2c9e5775.tar.gz rails-3205c768b7c592e5b96fdf6a6dd0fd3c2c9e5775.tar.bz2 rails-3205c768b7c592e5b96fdf6a6dd0fd3c2c9e5775.zip |
Changelog and doc updates for the previous changes.
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index edde37446a..a58f02098b 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -129,7 +129,7 @@ module ActiveRecord # # First: takes a block so it can be used just like Array#select. # - # Model.scoped.select { |m| m.field == value } + # Model.all.select { |m| m.field == value } # # This will build an array of objects from the database for the scope, # converting them into an array and iterating through them using Array#select. @@ -503,7 +503,7 @@ module ActiveRecord # Like #create_with but modifies the relation in place. Raises # +ImmutableRelation+ if the relation has already been loaded. # - # users = User.scoped.create_with!(name: 'Oscar') + # users = User.all.create_with!(name: 'Oscar') # users.new.name # => 'Oscar' def create_with!(value) self.create_with_value = value ? create_with_value.merge(value) : {} @@ -566,16 +566,16 @@ module ActiveRecord # end # end # - # scope = Model.scoped.extending(Pagination) + # scope = Model.all.extending(Pagination) # scope.page(params[:page]) # # You can also pass a list of modules: # - # scope = Model.scoped.extending(Pagination, SomethingElse) + # scope = Model.all.extending(Pagination, SomethingElse) # # === Using a block # - # scope = Model.scoped.extending do + # scope = Model.all.extending do # def page(number) # # pagination code goes here # end @@ -584,7 +584,7 @@ module ActiveRecord # # You can also use a block and a module list: # - # scope = Model.scoped.extending(Pagination) do + # scope = Model.all.extending(Pagination) do # def per_page(number) # # pagination code goes here # end |