lib/catissue/domain/collection_protocol.rb
def add_defaults_local
      super
      self.start_date ||= Java::JavaUtil::Date.new
      if sites.empty? then add_default_site end
      if coordinators.empty? and sites.size == 1 then
        coord = sites.first.coordinator
        coordinators << coord if coord
      end
      make_default_collection_event unless events.detect { |evt| CollectionProtocolEvent === evt }
    end
def add_defaults_local
      super
      self.start_date ||= Java::JavaUtil::Date.new
      if sites.empty? then add_default_site end
      if coordinators.empty? and sites.size == 1 then
        coord = sites.first.coordinator
        coordinators << coord if coord
      end
      make_default_collection_event unless events.detect { |evt| CollectionProtocolEvent === evt }
    end
def add_defaults_local super self . start_date ||= Java :: JavaUtil :: Date . new if sites . empty? then add_default_site end if coordinators . empty? and sites . size == 1 then coord = sites . first . coordinator coordinators << coord if coord end make_default_collection_event unless events . detect { | evt | CollectionProtocolEvent === evt } end
Sets the defaults as follows:
 * The start date is set to now.
 * The title is set to the short title.
 * If there is no CP coordinator and there is exactly one site with a coordinator, then the
   default CP coordinator is the site coordinator.
 * If there is no CP site and there is exactly one coordinator site, then the default CP site
   is the coordinator site.
Sets the defaults as follows : * The start date is set to now . * The title is set to the short title . * If there is no CP coordinator and there is exactly one site with a coordinator then the default CP coordinator is the site coordinator . * If there is no CP site and there is exactly one coordinator site then the default CP site is the coordinator site .