lib/rails/graphql/helpers/inherited_collection/array.rb in rails-graphql-1.0.0.beta vs lib/rails/graphql/helpers/inherited_collection/array.rb in rails-graphql-1.0.0.rc1
- old
+ new
@@ -2,9 +2,10 @@
module GraphQL
module Helpers
# A inherited collection of arrays that can be unique when it is a set
class InheritedCollection::Array < InheritedCollection::Base
alias size count
+ alias to_ary eager
# Provide similar functionality of any? but returns the object instead
def find(value = nil, &block)
block ||= !value.is_a?(Module) ? value.method(:==) : ->(val) { val.class <= value }
reverse_each { |item| return item if block.call(item) }