-
Notifications
You must be signed in to change notification settings - Fork 1
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
Rent logic #46
base: master
Are you sure you want to change the base?
Rent logic #46
Conversation
- need to add headings to distinguish top trans from top rent - need to reformat so all neighborhood show
$('#return-addresses').append(createNeighborhoodHTML(data[0][i])); | ||
} | ||
for (var i = 0; i < data[1].length; i++) { | ||
$('#return-rent').append(createNeighborhoodRentHTML(data[1][i])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good temporary solution to have both neighborhood priorities listed on the page.
|
||
def find_closest_rent_neighborhoods(user_max_rent) | ||
max_avg_rent = user_max_rent * 1.2 | ||
neighborhoods = Neighborhood.where('rent <= ?', max_avg_rent).order(rent: :desc).limit(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious how we decided to do 120% of their suggested rent. It might be good to test over time to make sure the top three neighborhood averages are at least reaching below the user-provided rent. What do you think?
neighborhoods = Neighborhood.where('rent <= ?', max_avg_rent).order(rent: :desc).limit(3) | ||
if neighborhoods.empty? | ||
Neighborhood.order(:rent).limit(3) | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This alleviates my previous concern, but might be good to do some testing to see how often the neighborhoods are returning empty arrays.
And comments out "add top rent neighborhoods" in case it was something else we needed.
@icorson3 Would you be able to review this PR along with me? I approve, but since it's adding functionality I'd like additional review before merging. :) |
Functioning according to interim plan of having top three rent results displayed along with top three transportation results.
View does not fit all six results currently - but may not be worth fixing at this time because we may ultimately decide to return three integrated neighborhoods.