suryart/spree_active_sale

View on GitHub
app/views/spree/admin/active_sales/get_children.json.erb

Summary

Maintainability
Test Coverage
[<% @active_sale_events.each_with_index do |t,i| %>
  { "attr" :
    { "id" : "<%= t.id %>", "parent_id" : "<%= t.parent_id %>" },
    "data" : "<%= raw(event_js_data(t)) %>"
    <% unless t.children.empty? %>
      ,"state" : "closed"
    <% end %>
  }<%= "," if i < (@active_sale_events.size - 1) %>
<% end %>]