class ActiveFedora::Associations::CollectionAssociation

def first_or_last(type, *args)

Fetches the first/last using solr if possible, otherwise from the target array.
def first_or_last(type, *args)
  args.shift if args.first.is_a?(Hash) && args.first.empty?
  #collection = fetch_first_or_last_using_find?(args) ? scoped : load_target
  collection = load_target
  collection.send(type, *args).tap do |record|
    set_inverse_instance record if record.is_a? ActiveFedora::Base
  end
end