def add(action, options = {})
      link =
        if action.is_a?(ActiveScaffold::DataStructures::ActionLink) || action.is_a?(ActiveScaffold::DataStructures::ActionLinks)
          action
        else
          options[:type] ||= default_type if default_type
          ActiveScaffold::DataStructures::ActionLink.new(action, options)
        end
      # NOTE: this duplicate check should be done by defining the comparison operator for an Action data structure
      existing = find_duplicate(link)

      if existing
        existing
      else
        # That s for backwards compatibility if we are in root of action_links
        # we have to move actionlink into members or collection subgroup
        group = (name == :root ? subgroup(link.type, link.type) : self)
        group.add_to_set(link)
        link
      end
    end
def add(action, options = {})
      link =
        if action.is_a?(ActiveScaffold::DataStructures::ActionLink) || action.is_a?(ActiveScaffold::DataStructures::ActionLinks)
          action
        else
          options[:type] ||= default_type if default_type
          ActiveScaffold::DataStructures::ActionLink.new(action, options)
        end
      # NOTE: this duplicate check should be done by defining the comparison operator for an Action data structure
      existing = find_duplicate(link)

      if existing
        existing
      else
        # That s for backwards compatibility if we are in root of action_links
        # we have to move actionlink into members or collection subgroup
        group = (name == :root ? subgroup(link.type, link.type) : self)
        group.add_to_set(link)
        link
      end
    end
def add ( action , options = { } ) link = if action . is_a? ( ActiveScaffold :: DataStructures :: ActionLink ) || action . is_a? ( ActiveScaffold :: DataStructures :: ActionLinks ) action else options [ :type ] ||= default_type if default_type ActiveScaffold :: DataStructures :: ActionLink . new ( action , options ) end # NOTE: this duplicate check should be done by defining the comparison operator for an Action data structure existing = find_duplicate ( link ) if existing existing else # That s for backwards compatibility if we are in root of action_links # we have to move actionlink into members or collection subgroup group = ( name == :root ? subgroup ( link . type , link . type ) : self ) group . add_to_set ( link ) link end end
adds an ActionLink, creating one from the arguments if need be
adds an ActionLink creating one from the arguments if need be