From 96050e1d73ff97b52f3ef3b79f813b75df615833 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Mon, 4 Mar 2013 09:04:48 -0300 Subject: [PATCH] Use 1.9 hash style in changelog and doc examples [ci skip] --- activerecord/CHANGELOG.md | 6 +++--- activerecord/lib/active_record/relation/query_methods.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index d265f04562..db0bb327bf 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -3,12 +3,12 @@ * Added functionality to unscope relations in a relations chain. For instance, if you are passed in a chain of relations as follows: - Posts.select(:name => "John").order('id DESC') + Posts.select(name: "John").order('id DESC') but you want to get rid of order, then this feature allows you to do: - Posts.select(:name => "John").order("id DESC").unscope(:order) - == Posts.select(:name => "John") + Posts.select(name: "John").order("id DESC").unscope(:order) + == Posts.select(name: "John") The .unscope() function is more general than the .except() method because .except() only works on the relation it is acting on. However, .unscope() diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 881ac687b3..ff3853b4d9 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -331,15 +331,15 @@ def reorder!(*args) # :nodoc: # which should be unscoped. The valid arguments are given in VALID_UNSCOPING_VALUES. # The method can also be called with multiple arguments. For example: # - # User.all.order('email DESC').select('id').where(:name => "John") + # User.all.order('email DESC').select('id').where(name: "John") # .unscope(:order, :select, :where) == User.all # # One can additionally pass a hash as an argument to unscope specific :where values. # This is done by passing a hash with a single key-value pair. The key should be # :where and the value should be the where value to unscope. For example: # - # User.all.where(:name => "John", :active => true).unscope(:where => :name) - # == User.all.where(:active => true) + # User.all.where(name: "John", active: true).unscope(where: :name) + # == User.all.where(active: true) # # Note that this method is more generalized than ActiveRecord::SpawnMethods#except # because #except will only affect a particular relation's values. It won't wipe -- GitLab