adds geozone info to admin spending proposal index

This commit is contained in:
Juanjo Bazán
2016-01-11 14:02:21 +01:00
committed by Juanjo Bazán
parent aee9a9d7c0
commit abe5085040
2 changed files with 6 additions and 1 deletions

View File

@@ -8,7 +8,10 @@
<% @spending_proposals.each do |spending_proposal| %>
<tr id="<%= dom_id(spending_proposal) %>">
<td>
<strong><%= spending_proposal.title %></strong>
<strong><%= link_to spending_proposal.title, admin_spending_proposal_path(spending_proposal) %></strong>
</td>
<td>
<%= geozone_name(spending_proposal) %>
</td>
<td>
<% unless spending_proposal.accepted? %>

View File

@@ -188,6 +188,7 @@ puts "Creating Spending Proposals"
resolutions = ["accepted", "rejected", nil]
(1..30).each do |i|
geozone = Geozone.reorder("RANDOM()").first
author = User.reorder("RANDOM()").first
description = "<p>#{Faker::Lorem.paragraphs.join('</p><p>')}</p>"
spending_proposal = SpendingProposal.create!(author: author,
@@ -196,6 +197,7 @@ resolutions = ["accepted", "rejected", nil]
description: description,
created_at: rand((Time.now - 1.week) .. Time.now),
resolution: resolutions.sample,
geozone: [geozone, nil].sample,
terms_of_service: "1")
puts " #{spending_proposal.title}"
end