aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-04 09:04:48 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-04 09:04:48 -0300
commit96050e1d73ff97b52f3ef3b79f813b75df615833 (patch)
treef3f92e1aa6881c867a015500ef135a0c01de8a60 /activerecord
parent8d69cd3e6815396dbab371de33a1615c73302ba9 (diff)
downloadrails-96050e1d73ff97b52f3ef3b79f813b75df615833.tar.gz
rails-96050e1d73ff97b52f3ef3b79f813b75df615833.tar.bz2
rails-96050e1d73ff97b52f3ef3b79f813b75df615833.zip
Use 1.9 hash style in changelog and doc examples [ci skip]
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md6
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb6
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 @@ module ActiveRecord
# 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