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

Followers/Following not working #127

Closed
PragTob opened this issue Mar 9, 2012 · 4 comments
Closed

Followers/Following not working #127

PragTob opened this issue Mar 9, 2012 · 4 comments
Assignees
Labels

Comments

@PragTob
Copy link
Member

PragTob commented Mar 9, 2012

Hey everybody,

clicking on the followers/following of a user gives you an error. I tried it with my account, a random account and Steve's account.

Can I access the error logs somehow? If I get to it I'll try to reproduce and fix it on my own machine today/tomorrow.

Tobi

@steveklabnik
Copy link
Member

Uh oh.

Can I access the error logs somehow?

I'd have to give you Heroku access, which I'm not 100% against, but... can you reproduce it on your machine, maybe? If not, I'll try it and get you a log

@PragTob
Copy link
Member Author

PragTob commented Mar 9, 2012

I'll try on my machine and hope that I can do it, if not I'll contact you :-)

However enjoy wroc_love.rb! =)

@ghost ghost assigned PragTob Mar 9, 2012
@PragTob PragTob closed this as completed in 597d083 Mar 9, 2012
@PragTob
Copy link
Member Author

PragTob commented Mar 9, 2012

So I fixed this, I took the liberty to introduce two css classes in order to make testing not such a pain :-)

I think that the root cause of this bug is that it is params[:id] or params[:user_id] whereas what's really in there is the username which lead to this wrong ORM query. Also I think it'd be nice if it would always be :user_id or :id or the resource helper method of the UsersController could be extended to handle both, like:

# current version
def resource
  @user ||= end_of_association_chain.find_by_username(params[:id])
end

# more flexible version
def resource
  @user ||= end_of_association_chain.find_by_username(params[:id] || params[:user_id])
end

Dunno if that would break anything though, if you want I could try that. But id's that are really usernames still hinders readability a bit in my eyes :-(

Tobi

@PragTob
Copy link
Member Author

PragTob commented Mar 9, 2012

Oh yeah I closed this issue but I guess that the changes still have to be deployed :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants