Method: ActiveFedora::FinderMethods#find
- Defined in:
- lib/active_fedora/relation/finder_methods.rb
#find(*args) ⇒ Array
Returns objects of the Class that find is being called on.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/active_fedora/relation/finder_methods.rb', line 32 def find(*args) return to_a.find { |*block_args| yield(*block_args) } if block_given? = args. = .dup cast = if @klass == ActiveFedora::Base && !.key?(:cast) true else .delete(:cast) end if [:sort] # Deprecate sort sometime? sort = .delete(:sort) [:order] ||= sort if sort.present? end raise ArgumentError, "#{self}.find() expects an id. You provided `#{args.inspect}'" unless args.is_a? Array find_with_ids(args, cast) end |