app/models/item.rb
# Searches orders associated with this item and returns next upcoming access date
Searches orders associated with this item and returns next upcoming access date
Searches orders associated with this item and returns next upcoming access date
def next_scheduled_use_date
    next_date = nil
    open_orders.each do |o|
      if o.access_date_start
        next_date ||= o.access_date_start
        if o.access_date_start < next_date
          next_date = o.access_date_start
        end
      end
    end
    next_date
  end
def next_scheduled_use_date next_date = nil open_orders . each do | o | if o . access_date_start next_date ||= o . access_date_start if o . access_date_start < next_date next_date = o . access_date_start end end end next_date end
Searches orders associated with this item and returns next upcoming access date
Searches orders associated with this item and returns next upcoming access date