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

Denormalizing using inverse_of #8

Merged
merged 4 commits into from Jun 18, 2013
Merged

Denormalizing using inverse_of #8

merged 4 commits into from Jun 18, 2013

Conversation

suruja
Copy link
Contributor

@suruja suruja commented Apr 21, 2012

Hello!

I also met the same issue refered in this pull request, but I did not solved this using the same way. I prefered to use mongoid native inverse_of instead.

@icambron
Copy link
Contributor

icambron commented May 2, 2012

Yeah, this is the superior to my fix. I missed inverse_of. I also like the ancillary changes. +1

@suruja
Copy link
Contributor Author

suruja commented May 2, 2012

Thank you! I probably should have make the ancillary changes (the query speed up thing) on a new other branch, it would have been cleaner. But I hope this pull request will be accepted though.


chgs = assigns.inject({}){ |m,(k,v)| m["#{prefix}_#{k}"]= v; m }

if association_s == association_s.pluralize
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am working on getting this PR updated with the latest code. I'm probably going to change this line though. I'm not sure that relying on the inflections to determine whether an association is a "many" is better than checking the macro of the relation.

@rehevkor5 rehevkor5 mentioned this pull request Jun 18, 2013
@rehevkor5 rehevkor5 merged commit f7cabb3 into logandk:master Jun 18, 2013
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

Successfully merging this pull request may close these issues.

None yet

3 participants