Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Foreign keys set to nil when retrieving associations with filters that yield no results #235

Open
lsimoneau opened this issue Jan 22, 2013 · 4 comments

Comments

@lsimoneau
Copy link

If Listing has n, :tags, :through => :listing_tags, then the following:

@listing.listing_tags.tags(category: "niche")

sets the tag_id of any ListingTag for which there are no Tags in the "niche" category to nil.

Here's a full test case:

https://gist.github.com/4591743

@d11wtq
Copy link
Contributor

d11wtq commented Jan 22, 2013

Hi Dan & Co.

Looking at the tag history for dm-core, there hasn't been a release for a year. I know you're working on DM2, but that's a long way off being released, so it makes sense to continue to maintain DM1 in the interim and make bugfix releases at the very least. Many of us are left out in the cold while DM2 is being developed. Even PRs are being ignored, so nobody feels like sending them at the risk of just being ignored.

I don't think it should take huge amounts of time, but just try and keep on top of the maintenance/bugfix releases for all those users who are using DM in production ;) I think I can fix this, but I feel close to 100% certain that my PR would not get merged in, based on past PRs I've made.

Cheers,

Chris (Louis' colleague)

@gavinlaking
Copy link

Just seen this happen myself. Wondering how far off DM2 actually is.

@tpitale
Copy link
Member

tpitale commented Feb 8, 2016

I'm taking a look at this for DM 1.3.0. DM2 is no longer being developed AFAICT.

@tpitale
Copy link
Member

tpitale commented Feb 8, 2016

Changing the listing.listing_tags.tags(category: 'other') to listing.listing_tags.tags.all(category: "other") does appear to bypass the problem. But, I'm still trying to dig into what caused the original issue.

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

No branches or pull requests

4 participants