Crowdhound connects dog owners with local people that would love the opportunity to chill with a dog for an afternoon or a few days, without having the responsibility 24/7/365.
Update dogs query to use Dog::sorted_by_distance if authenticated current_user has a location. In that case, dogs whose owner does not have a location are not included in the results.
Order users and unauthenticated dogs queries by id to prevent intermittent test failures
DRY up CurrentUserType by inheriting from Types::UserType
Mock time for tests of age queries
Raise error in Location before_save :update_latlong if the address input is invalid (no geocoding results)
Catch edge cases in User#distance_to for the current user or the target dog/user not having a location -- return nil
Add actual addresses for location seeds
Resolves #67, related to user story #7
The following checks have been completed:
[x] Tested my new feature(s) as well as any feasible edge cases (if possible)
[x] Checked coverage/index.html - did not add any new code that's not covered by testing (if possible)
[x] Merged in the latest master to my branch with git pull origin master & resolved merge conflicts
[x] Ran rails db:migrate
[x] Ran the test suite - all tests are passing (or maybe skipped)
[x] Checked affected endpoints in Postman / GraphiQL
[x] Updated README for changes (new endpoints, new gems, etc)
Changes proposed in this pull request:
::sorted_by_distance
fromUser
toDog
distance
attribute toUserType
andDogType
dogs
query to useDog::sorted_by_distance
if authenticatedcurrent_user
has a location. In that case, dogs whose owner does not have a location are not included in the results.users
and unauthenticateddogs
queries byid
to prevent intermittent test failuresCurrentUserType
by inheriting fromTypes::UserType
Location before_save :update_latlong
if the address input is invalid (no geocoding results)User#distance_to
for the current user or the target dog/user not having a location -- return nilResolves #67, related to user story #7
The following checks have been completed:
coverage/index.html
- did not add any new code that's not covered by testing (if possible)git pull origin master
& resolved merge conflictsrails db:migrate