Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update seeds for trails #2

Merged
merged 3 commits into from
Sep 20, 2017
Merged

update seeds for trails #2

merged 3 commits into from
Sep 20, 2017

Conversation

wratterman
Copy link
Collaborator

@wratterman wratterman commented Sep 18, 2017

@Mcents @Mcents See Pull Request for updated Trail seeds that @DesTodo and I worked on

There is only one changed file, and we reuse the HikingProjectService.search(args) method that was already built, but we override the default arg values and make sure we expand the params to the Max number of results and the max radius from the provided coordinates. This is found on lines 118:124 in db/seeds.rb. It overrides the default attrs in the method below from lines 8:11 in app/services/hiking_project_service.rb...

  def self.search(search_params = { lat: 39.742043, lon: -104.991531, maxResults: 50 })
    response = new(search_params).search
    JSON.parse(response, :symbolize_names => true)
  end

See Hiking Project documentation here

  • To re-setup your db, run bundle exec rake db:reset and you should be good.

Copy link
Collaborator

@DesTodo DesTodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code works and we now have real trails data from the hiking project service; an unexpected bonus is that the app was already set up with Google Maps API and this improvement now allows for an interactive map experience too -- complete with a picture for each location as well as directions.

@DesTodo DesTodo merged commit 8c7df5f into development Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants