提交 95c24e9f 编写于 作者: K Kevin Dougherty

Add methods to array delegation from `Relation`

Delegation of some `Array` methods was removed in commit 9d79334a. That
change did add explicit delegation of a few methods that `Array` has but
which aren't on `Enumerable`.  However, a few non-mutation methods were
omitted.  This adds `Array` delegation of `#in_groups`, `#in_groups_of`,
`#shuffle` and `#split`.  This allows things like
`MyThing.all.in_groups_of(3) { ... }` to continue working as they did
before commit 9d79334a.
上级 be08291e
......@@ -37,7 +37,8 @@ def inherited(child_class)
# for each different klass, and the delegations are compiled into that subclass only.
delegate :to_xml, :to_yaml, :length, :collect, :map, :each, :all?, :include?, :to_ary, :join,
:[], :&, :|, :+, :-, :sample, :shuffle, :reverse, :compact, to: :to_a
:[], :&, :|, :+, :-, :sample, :reverse, :compact, :in_groups, :in_groups_of,
:shuffle, :split, to: :to_a
delegate :table_name, :quoted_table_name, :primary_key, :quoted_primary_key,
:connection, :columns_hash, :to => :klass
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册