-
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
Add styling and additional logic to search for users #152
Conversation
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 added some suggestions that assign the instance variables in the view as the users controller would do
The code looks great now! The PR has also a size that is very good reviewable. Just one question: def search
@users = User.search(params[:search]).where.not(id: current_user.id)
@users_to_add = @users.reject do |user|
current_user.sent_contact_request?(user)
end
end It looks like def search
other_users = User.search(params[:search]).where.not(id: current_user.id)
@users_to_add = other_users.reject do |user|
current_user.sent_contact_request?(user)
end
@users = other_users.select do |user|
current_user.sent_contact_request?(user)
end
end |
Sorry for this chaotic PR of mine 🙈 . I really don't know why I implemented stuff that was already existing. But thanks for all your feedback and patience.
You are absolutely right. Good eye. I adjusted the code. |
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.
Nice to finally finish this 🎉 I'm sorry for having so much comments but thank you for implementing all of it :)
I can not reproduce the error. @frcroth what exactly did you do? (For example: login, click the search icon, ...) |
@felixauringer thanks that would be really nice. If you can not find the error, please ping me and I can also have a look this evening. |
Works locally for me, so I will have a look at the heroku logs |
The relevant part is
|
So again problems with the avatars. This PR did not touch |
That's executed on production data: User.all.select { |user| user.avatar.nil? }.length
D, [2021-02-06T15:08:13.259421 #4] DEBUG -- : User Load (1.8ms) SELECT "users".* FROM "users"
=> 0 So the migration worked as expected |
I added an issue for this: #191 |
This PR closes #127 and closes #98 .
In the navbar is now an icon that is redirecting the user to the search page.
The styling is now looking as follows:
Desktop:
Mobile: