Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about multiple has_many relationships on one model sharing a predicate, or allow them to produce a solr query that can discriminate on the class_name attribute #25

Closed
jcoyne opened this issue Jan 7, 2013 · 5 comments

Comments

@jcoyne
Copy link
Member

jcoyne commented Jan 7, 2013

Formerly HYDRA-875

class Catalog < AF::Base
has_many :releases, :class_name=> "Album", :property=> :is_part_of
has_many :tracks, :class_name=> "Track", :property=> :is_part_of
end

Catalog#releases.send(:construct_query)
produces a query like: is_part_of_s:info:fedora/catalog:7"
which is the same as
Catalog#tracks.send(:construct_query)
=> is_part_of_s:info:fedora/catalog:7"

So Catalog#releases returns the same objects as Catalog#tracks.

@blimey74
Copy link

Hi, I think this bug could be affecting some work we're trying to do here at the Royal Library in Copenhagen, is there a workaround or an ETA for the issue?

@jcoyne
Copy link
Member Author

jcoyne commented Jan 26, 2013

The workaround is to use different predicates (sub-types) for each association. I don't think anyone is working on this right now.

jcoyne added a commit that referenced this issue Jan 28, 2013
@jcoyne
Copy link
Member Author

jcoyne commented Jan 28, 2013

@blimey74 I've fixed it in the 6.x branch. Is there another release that you would like it backported to?

@blimey74
Copy link

@jcoyne a backport to active-fedora 5.5.0, would be really great, thanks!

@jcoyne jcoyne closed this as completed in ef3accc Jan 28, 2013
@jcoyne
Copy link
Member Author

jcoyne commented Jan 28, 2013

@blimey74 This patch has been released in active-fedora 5.5.2

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

No branches or pull requests

2 participants