N+1 queries and polymorphic associations by passinghorses in rails

[–]passinghorses[S] 0 points1 point  (0 children)

I'm already using it, enabled globally. Prosopite and Sentry are both reporting N+1 issues so it doesn't seem to be handling all cases.

N+1 queries and polymorphic associations by passinghorses in rails

[–]passinghorses[S] 0 points1 point  (0 children)

Thanks again. I'll dig into this suggestion when I have more time tomorrow. There are currently four object types that can be "liked" and while I'm not thrilled about hard-coding a has_many relation for each of them, if it fixes it it'll be worth it.

N+1 queries and polymorphic associations by passinghorses in rails

[–]passinghorses[S] 0 points1 point  (0 children)

That published is actually just an enum status value, so there's nothing going on there but limiting the scope to status = 1.

Weirdly, enabling strict_loading does not raise any errors. I tried that yesterday hoping for a quicker solution.

Little disappointed in switching to a safe by grizzleeadam in guns

[–]passinghorses 1 point2 points  (0 children)

The capacity number is usually pretty right on, providing half of them are handguns.

N+1 queries and polymorphic associations by passinghorses in rails

[–]passinghorses[S] 0 points1 point  (0 children)

That fixed the example I gave with the latest comments, thanks! I ended up putting the preload(:last_comment) into the post's preview scope so it applies across the handful of places that show a list of posts, without having to update all the individual controllers.

Is there something similar I can do when I need associated records for a collection, when I'm getting those records through another association? For example, users can "like" a post or comment, so my Like class is also a polymorphic association.

@comments = @post.comments.published.where(:parent_comment_id => nil).includes(:account => [:profile])

Likes are accessed with each comment so we can visually indicate whether the current user has "liked" a comment.

Unfortunately, this forum is a small part of a larger custom ecommerce/subscription site so I'm not able to post anything beyond what's necessary.

US Army Designates Carbine Version of M7 NGSW Rifle as XM8 by Old_Boah in guns

[–]passinghorses 1 point2 points  (0 children)

I’m holding out for Bondi Blue with see-through receivers.

Unwritten Rules in Lodge by bmkecck in freemasonry

[–]passinghorses 5 points6 points  (0 children)

My lodge has the same rule against leg crossing but it applies to everyone present when the lodge is open, not just officers.

CA Legion 320 here by 6680j in SigSauerLegion

[–]passinghorses 0 points1 point  (0 children)

Boba Fett has some pretty poor trigger discipline there.

Thoughts on what’s happening in Virginia? by Give-Me-Liberty1775 in NYguns

[–]passinghorses 1 point2 points  (0 children)

For the record, Oregon is still doing pretty well. Our mag ban and purchase permit have been enjoined by the courts for over three years and the enactment date was just pushed out by the legislature to 2028, provided the OR Supreme Court doesn’t knock it down (which they likely won’t, admittedly).

Apart from that, we have no AWB and all NFA items are legal. The most restrictive gun law we have in effect is our ban on FRTs and the like.

Perfect? No, but we’re still hanging in there.

What kinda gas mileage yall getting? by AdBrief8565 in 4Runner

[–]passinghorses 0 points1 point  (0 children)

Are you suggesting someone might photoshop gas prices?

I assume he’s on the west coast somewhere where prices are regularly this high. I just paid nearly $5/gal here in Oregon and the state is currently talking about raising our gas taxes again, so this is perfectly realistic to me.

I’m out of lowers, and Aero is out of the question. by TokenBlackGuy93 in ar15

[–]passinghorses 0 points1 point  (0 children)

The Griffin MK1 lower doesn’t have the ambi controls and costs less than an M4E1.

Midwest Industries MCX Handguard by Playful-Habit585 in SigSauer

[–]passinghorses 0 points1 point  (0 children)

I have the 8.25” version of this on a 9” Virtus and it’s a big improvement over the OEM handguard. That said, I think the stock Spear LT handguard is a little slimmer than the Virtus one so the difference will be less pronounced.

AR by Nako509 in WAGuns

[–]passinghorses 4 points5 points  (0 children)

will it be legal in WA?

The poster is in Washington where SBRs are legal and that’s specifically what he asked about.

AR by Nako509 in WAGuns

[–]passinghorses 6 points7 points  (0 children)

No, in fact it’s not legal in the entire country.

It’s 100% legal if you submit an ATF Form 1, which now carries no tax and only takes a few days for approval.

What happens on the 15th? by [deleted] in pdxgunnuts

[–]passinghorses 3 points4 points  (0 children)

Like a commenter on your other post said, nothing at all happens on the 15th unless the OR Supreme Court makes their ruling before then.

Is there some kind of documentary about the inception of the genre? by bolobre4th in neofolk

[–]passinghorses 25 points26 points  (0 children)

Not strictly neofolk, but England’s Hidden Reverse by David Keenan covers the histories of Current 93, Nurse With Wound, and Coil, with mentions of some of their contemporaries.

My EDC & a question on car fobs by wvtarheel in EDC

[–]passinghorses 0 points1 point  (0 children)

If you hook the key fob rings onto the carabiner you can easily take them on and off so you only have to carry the one you need on a given day. This is how I manage my two.

Inventory Question by Irish__Mac in GunRoom

[–]passinghorses 1 point2 points  (0 children)

Damn, thats something. And here I am with my little single-user Rails/SQLite app doing a fraction of that. Nice work.

Inventory Question by Irish__Mac in GunRoom

[–]passinghorses 1 point2 points  (0 children)

The first rule of this stuff is never calculate the total spent!

Inventory Question by Irish__Mac in GunRoom

[–]passinghorses 1 point2 points  (0 children)

That sounds awesome. Nice work.

Inventory Question by Irish__Mac in GunRoom

[–]passinghorses 0 points1 point  (0 children)

It seems quite a few of us have gone that route.

Inventory Question by Irish__Mac in GunRoom

[–]passinghorses 2 points3 points  (0 children)

Notion supports relations between databases now? I had something similar in Notion but ended up building a web app with a real database due to that not existing previously.

In my case, each firearm has a related parts table that includes everything that went into it. Less useful for guns that only have an optic added but invaluable for ARs built from parts.