Brady Bouchard

Results 13 comments of Brady Bouchard

To sum all votes for posts for a particular user: `User.find(...).posts.map(&:votes_for).sum` To sum all votes for subtracted from votes against for a particular user, who created posts: `User.find(...).posts.map(&:plusminus).sum` If you're...

By denormalize, I mean you can store the computed value on the User model (if you have lots of posts, would be useful, but not necessary - just for performance...

Hello, As the code to calculate weight is in Ruby rather than in the DB, this will be inherently slow for large DB tables. With that caveat, the formula we...

That would be a useful method to add to thumbs_up! I would encourage you to look at the source (most of it is quite straightforward), and I'll be happy to...

`i` right now is used to blow up an image in a question so you can see it fill the window, but you can modify anything to do anything. Relevant...

Hey Justin, Not sure what's going on, thumbs_up does use some complicated queries so that could very well be at fault. An easy workaround would be to paginate the objects...

Feel free to take a stab at fixing this query, I'm happy to take pull requests if we can make it work with will_paginate, but unfortunately I won't be able...

Happy to take pull requests if you want to fix it!

This is already handled by the fact that asset_packager checks to see if the packaged files exist, and then rebuilts if they're absent. Can you elaborate on why you're deploying...

Ah, there be your problem then. Your deployment strategy, whatever it is, shouldn't be copying files over your old deployment... at the very least you should be using "rsync --delete-after"...