Looking for Guidance/Mentoring – Active Record Query?

So I have this project over on github, simply named [nba](https://github.com/jemagee/nba). It's probably not the most intelligent choice for a learning project, but it's something I have wanted to do for a long time so I started building it.

The tables are set up, the data is scraped from nba.com and populated into the table (though there is more data available I thought I'd get to once I learned to manipulate the simple stuff) and now I want to get into figuring out how to show some data (behind the NBA standings for the test data that I figured out, and that probably took longer than it should have and the code is probably a bit ugly).

If you know about sports statistics, often you have to qualify players...minimum minutes played, I did come up with a formula on my own to qualify players, so that I have a method in the Player model called qualified that will get me all the player id's of those players qualified to be in standings competition.

Now i want to say list the top 10 scorers, the top 10 assist people, etc...FROM that qualified set.

But, since I'm learning, I'm being a bit difficult about it (I think). I could write the raw sql for this with absolutely no problem, I love writing SQL queries, I love normalizing data...but what I want to do is write those really complex queries and make them work in Rails with AR as much as possible, and I need some help for that.

I know there's no code here, because this isn't a simple one word thing, and I know it's a long shot, but if there's anyone who is good with writing active record queries, converting sql queries (multiple table joins, sub queries, etc...) into the ARQ and has the time to maybe work with someone, purely online, purely out of the goodness of their heart, it would be greatly appreciated. I realize it's probably a long shot of course, but what the hell.

If you would be interested in helping at all - or just commenting on the code - feel free to review the repository and comment, suggest, or rip it to shreds, thanks

Leave a Comment