lib/trello_helper.rb
# Associate sortable metadata to one trello card
Associate sortable metadata to one trello card
Associate sortable metadata to one trello card
def sortable_card(card)
    sortable_card_labels = card_labels(card).map { |label| sortable_card_label(label) }.select { |label| !label.nil? }
    if !sortable_card_labels.empty?
      label_data = sortable_card_labels.first
      sortable_card_labels[1..-1].each do |label|
        if labels_in_order(label_data, label)
          label_data = label
        end
      end
    end
    label_data = label_data ? label_data.dup : SortableCard.new
    label_data.card = card
    label_data.new_pos = card.pos
    label_data
  end
def sortable_card ( card ) sortable_card_labels = card_labels ( card ) . map { | label | sortable_card_label ( label ) } . select { | label | ! label . nil? } if ! sortable_card_labels . empty? label_data = sortable_card_labels . first sortable_card_labels [ 1 .. - 1 ] . each do | label | if labels_in_order ( label_data , label ) label_data = label end end end label_data = label_data ? label_data . dup : SortableCard . new label_data . card = card label_data . new_pos = card . pos label_data end
Associate sortable metadata to one trello card
Associate sortable metadata to one trello card
card