GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Matthias Folz and I've added associations (has_many and has_one) via reflection classes to ActiveResources.
Here is the link to the googlegroups discussion:
And the lighthouse ticket:
I hope, it's not impolite to open a pull request without an answer on the lighthouse ticket form a core member.
If it's so: I'm sorry... ;)
This ticket would be the begin of extending active resource with more restful features.
(like association link resolving as seen in Atomic-feeds)
What about belongs_to? If we add has_many and has_one is intuitive to have belongs_to associations, right?
in the first step, we've added just has_one and has_many associations to configurate the :class_name (more options will follow), which should be used for the initialization of associated objects.
(more detailed description in the linked Lighthouse ticket)
So, before it get merged, we should add a belongs_to association, that adds an accessor for the parent, which it belongs to?
Should we also add some autoresolving for a belongs_to association, if the request response (for i.e. Comment.find(2) ) only includes the 'post_id' instead of all attributes (nested) for the 'post' object. ?
Sorry... i closed the pull request by mistake... :)
Please remember to include the guides updated with this change, to make it a complete request.
I just rebased to the latest rails master, so the least added commits aren't new commits.
this -> those
specify -> specified
@SweeD: Do you finish belongs_to?
@core members: is there any chance you can review this for inclusion in Rails 3.2?
Sorry, I was on vacation.
We will finish it within the next two weeks.
You have two more days to complete your patch :P (haha, just j/k)
I'll come back and check again after you've finished it. If you can finish belongs_to, and squash some of the tiny commits that would be great. :)
Just a friendly reminder, I keep an eye on this too, hahaha :D
Woohoo... haven't forgot.... We'll finish it.
Little bit stressful these days... :D
Please don't stone me... xD
Looks like this is finished, I see belongs_to added on the code, I will start to test this now :)
@SweeD: great work!!!
Sorry, it's not finished, already.
But almost... ;)
Have to write the resolving of the parent for a belongs_to association and squash the tiny commits... :)
Will finish these days!
"differend" -> "different"
Try to use autoload_at here, i.e.
autoload_at 'active_resource/associations/builder' do
Good idea and nice implementation. Targeting Rails 3.2.
+1 this is awesome.
@SweeD what's the progress of this patch? I want to make sure this can be merged into Rails 3.2 ;)
+1, this should be in master soon :)
Oha, haven't got time for a while.
Will finish it this month, sorry about that. ;)
@sikachu we "just" have to finish the belongs_to association and then, we're done.
Have to write the resolving of the parent for a belongs_to association and squash the tiny commits...
Rails 3.2 release candidate is coming within days, so this is going to miss the boat without a final push!
We will work on it today and hopefully finish it tomorrow.
Noting that the last comment is from Dec 15th with a hopeful finish by Dec 16th. Just wanted to bump this to see if the status has changed.
..but sadly, the status haven't changed since 15.12.
But we will finish it 100% this weekend.
Added ActiveResource - Association-Builder and Reflections
Added comments for ActiveResource::Associations has_many and has_one
ActiveResource::Reflection now recognized by find_or_create_resource_…
Added belongs_to association to active_resource
@sikachu ....and finally: Done! :D
Really, really sorry for the delay.
Looking forward to feedback... :)
Something to change/cleanup or so?
Closed for new pull request in new rails/activeresource repo.
Oh... it's the first one... xD