Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Commit

Permalink
Add specs for places and candidates.
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-buente committed Mar 18, 2014
1 parent 501806d commit f6af4f2
Show file tree
Hide file tree
Showing 5 changed files with 1,130 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/admin/candidate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def create
private

def resource
@candidate = Candidate.find(params[:id], params[:osm_type]) if params[:id]
@candidate ||= Candidate.new(@place.attributes)
@candidate = Candidate.find(params[:id], params[:osm_type] || 'node') if params[:id]
@candidate ||= Candidate.new(parent.attributes)
end

def parent
Expand Down
6 changes: 5 additions & 1 deletion app/admin/place.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
end

collection_action :next, title: false do
redirect_to admin_place_path(collection.first)
if collection.first
redirect_to admin_place_path(collection.first)
else
redirect_to admin_places_path, notice: "Das war der letzte Ort."
end
end

collection_action :upload_csv, title: "Upload Dataset" do
Expand Down
Loading

0 comments on commit f6af4f2

Please sign in to comment.