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

Commit

Permalink
Add logging output and move method into decorator.
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-buente committed Mar 12, 2014
1 parent 88c0cc4 commit 6da40c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions app/admin/place.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ def scoped_collection
link_to place.name, place_path(place, params)
end
column :address, sortable: :street
column :distance do |place|
number_to_human(place.distance_to(current_admin_user), units: :distance, precision: 2) unless place.location.blank?
end
column :distance
end

show do
Expand Down
5 changes: 5 additions & 0 deletions app/decorators/place_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ def wheelchair_status
end
end

def distance
logger.error([model.location.to_s, current_admin_user.location.to_s, model.distance_to(current_admin_user)/1000])
number_to_human(model.distance_to(current_admin_user), units: :distance, precision: 2) unless model.location.blank?
end

def matching_status
if model.osm_id
colum_header = fa_icon("check-square-o")
Expand Down

0 comments on commit 6da40c7

Please sign in to comment.