Skip to content
This repository
Browse code

Remove .all usage from unscope doc examples [ci skip]

  • Loading branch information...
commit 2e28045b487d66cbd5519317ec18a93c65a4d04b 1 parent 96050e1
Carlos Antonio da Silva carlosantoniodasilva authored
8 activerecord/lib/active_record/relation/query_methods.rb
@@ -325,21 +325,21 @@ def reorder!(*args) # :nodoc:
325 325 # This is useful when passing around chains of relations and would like to
326 326 # modify the relations without reconstructing the entire chain.
327 327 #
328   - # User.all.order('email DESC').unscope(:order) == User.all
  328 + # User.order('email DESC').unscope(:order) == User.all
329 329 #
330 330 # The method arguments are symbols which correspond to the names of the methods
331 331 # which should be unscoped. The valid arguments are given in VALID_UNSCOPING_VALUES.
332 332 # The method can also be called with multiple arguments. For example:
333 333 #
334   - # User.all.order('email DESC').select('id').where(name: "John")
  334 + # User.order('email DESC').select('id').where(name: "John")
335 335 # .unscope(:order, :select, :where) == User.all
336 336 #
337 337 # One can additionally pass a hash as an argument to unscope specific :where values.
338 338 # This is done by passing a hash with a single key-value pair. The key should be
339 339 # :where and the value should be the where value to unscope. For example:
340 340 #
341   - # User.all.where(name: "John", active: true).unscope(where: :name)
342   - # == User.all.where(active: true)
  341 + # User.where(name: "John", active: true).unscope(where: :name)
  342 + # == User.where(active: true)
343 343 #
344 344 # Note that this method is more generalized than ActiveRecord::SpawnMethods#except
345 345 # because #except will only affect a particular relation's values. It won't wipe

0 comments on commit 2e28045

Please sign in to comment.
Something went wrong with that request. Please try again.