#RubyOnRails - 29 April 2018
« Back 1 day Forward 1 day »
[10:45:31] acovrig: I’m working on a photo management system, Pic has_many Tag through PicTag; to display the tags I have a tag.pics.last.fname, which works fine, but it makes page loads take ~2s given it has N(tags)+1 queries to run to dispaly that, how would I change my queries to be faster?
[11:03:33] acovrig: if I do an includes, can I specify which columns I want (for the large select in (id array))?
[11:05:38] acovrig: just adding a .select(:id, :fname) to the Pic.where() elsewhere in my controller went from 17ms -> 3ms so I’m guessing if I did the same on an includes(:pics) then it’d greatly help too
[16:09:01] oded: How do I use .coffee.erb with webpacker? I have installed both coffee & erb loader, and I added .coffee.erb to the extensions list in webpacker.yml
[20:02:41] big_reggie: anyone use Devise and know why the RESTful routes are not on a per-user basis?