draper
draper copied to clipboard
Decorators/View-Models for Rails Applications
I am currently working on a project that involved wrapping a set of models with decorators to extend their behavior. I was getting very strange results until I realized that...
Coming from https://github.com/jeremyevans/sequel/issues/1201#event-685844858 I'm replacing a rails project AR layer with sequel, which uses draper. Although there is no built in support in draper for Sequel (the `.decorate` mixin is...
Is there a preferred / recommended way to do that with (or without) draper? I wanted to add some view-related class methods to all models without touching their definitions in...
This is probably related to https://github.com/drapergem/draper/issues/646, but my specific problem is with unpersisted objects, i.e. if there is an unsaved object in an association in the same example code (`user...
HI everyone, I have an parse json and I use active_model_serializers. In article_seriallizer.rb I call object.decorate and it throw error: ``` Draper::UninferrableDecoratorError - Could not infer a decorator for ActiveRecord::Base.:...
I am working to put draper working with kaminari, I have tried various solutions and followed issue #401, however, it still doesn't work for me. Here is the codes i...
Cleaned up implementation of #610 with Mongoid support
There was kinda same issue here: https://github.com/drapergem/draper/issues/260 The issue is also with has_many :through associations. ``` ruby has_many :voted_users, :through => :votes, :source => :user ``` and then i check...
Hello, I was wondering if the draper gem is still actively maintained, it looks like there was an update 12 months ago. So not sure.
## Description Implementing `Decorator.find` improves compatibility with Global ID and allows one to use decorated objects in background jobs seamlessly. ## Testing 1. Decorate an object. 2. Serialize the decorated...