提交 9025f495 编写于 作者: X Xavier Noria

Merge pull request #9540 from dimko/patch-1

Fixed typo in active record's changelog
......@@ -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')
User.where(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")
User.where(name: "John").order('id DESC').unscope(:order)
== User.where(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()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册