Activerecord relations - #610
Conversation
|
I really like this idea overall. I don't have enough time to give it a proper review right now, though. :/ |
|
Could you rebase this, please? I've updated the travis file to actually build the correct rubies, and I'd like to see if it passes. Thanks! |
…et/draper into activerecord-relations
|
Looks like it isn't passing. I'll have some free time after wednesday so will look into getting everything passing. |
|
Well that was easier than expected. Seems to be passing now. |
|
I confirm it works very well. Thanks @donaldpiret ! |
|
Any idea when this will be merged? I'm having an issue where I do @current_user = User.find(user_id).decorate. But then when I call @current_user.some_associated_model, it's telling me that the method doesn't exist. This pull request seems like it would fix that... |
|
It no longer merges correctly, and needs a rebase |
|
@magicmarkker Thanks for the head's-up. I'll try to rebase it later today or tomorrow when I have a bit of time. |
…et/draper into activerecord-relations Conflicts: lib/draper.rb
|
@magicmarkker @steveklabnik Rebased. Some of the builds are failing on Travis but those don't seem to have anything to do with my changes, and apparently has been failing since https://travis-ci.org/drapergem/draper/builds/35338408 |
|
|
|
Done! |
|
I'm interested in this. Let's see if we can get it passing on CI. |
|
I'll try to spend some time on this tomorrow to bring it up to date. Using my branch in production so would love to see it merged in as well. |
|
Getting one failure with mongoid. Not super familiar with it so might take me a little bit of time to get around. |
|
Closing in favor of cleaned up version: #662 |
|
👍 @donaldpiret, DecoratorRelation will be able to do |
Better handling of activerecord relations. One can now call the decorator anywhere in the scope chain, and keep your relation decorated. Once you call methods that access individual records or arrays of records it automatically converts your result to a collection decorator or a regular decorator.
Would love to get some feedback on this.