-
Notifications
You must be signed in to change notification settings - Fork 527
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
Add :namespace option to decorate #899
Conversation
@n-rodriguez huge respect for the work you've put into this, it looks like you've done a great job. I was just struggling with decorating a namespaced model for a while and came across this PR. I wanted to comment because ended up solving my problem a very simple way: by namespacing the decorator the same way as the model. In my case, I just pushed a PR with a namespace example. (I don't believe it conflicts with this PR in any way.) Would love to hear your comments on it because you know so much about this area 🙂 |
It is indeed a solution. But you may not want to do that (namespacing the decorator the same way as the model) but instead use more "conceptual" namespaces. For instance, my Rails app is splited into 3 different websites (1 Rails app with 2 engines) sharing the same database. So there are 3 decorators namespaces : one for each websites and those namespaces are not bound to a specific model. It looks like : module BackOffice
# resides in Rails app : rails_root/app/decorators/back_office/application_decorator.rb
class ApplicationDecorator < Draper::Decorator
end
class UserDecorator < ApplicationDecorator
end
end
module FrenchSite
# resides in engine : engine/french_site/app/decorators/french_site/application_decorator.rb
class ApplicationDecorator < Draper::Decorator
end
class FooDecorator < ApplicationDecorator
end
end
module SpanishSite
# resides in engine : engine/spanish_site/app/decorators/spanish_site/application_decorator.rb
class ApplicationDecorator < Draper::Decorator
end
class BarDecorator < ApplicationDecorator
end
end You can do that only with this PR. |
Ping @codebycliff |
Hi there! Any news? |
Ping @codebycliff. It would be nice to have some news... I hope I've not worked for nothing.... |
ping @codebycliff |
ping @codebycliff |
is it possible to have some fucking news? |
@n-rodriguez While I understand your frustration and apologize for the delay, I don't appreciate the language and don't really think anyone in the industry would either. We are all volunteers here – where we are in fact working for nothing. The reason for my delay is two fold: The first being I simply don't have the time to maintain this gem anymore. My work and personal responsibilities have changed significantly since I took on the maintenance of this gem and I don't have the same amount of free time that I once did. The second reason is the nature of this change. This pull request is adding more functionality around inference, which is the largest headache of this gem. When I originally took over maintenance of this gem, the original author (@jcasimir) really wanted me to remove the inference entirely per this issue. While I never was able to lead up that effort, I'm hesitant to introduce more functionality around the If you (or anyone else) would like to volunteer to helping maintain the repository going forward, that is something we can discuss. I just don't want to merge new features and not be around to support them. Let me know your thoughts. Again, I apologize for the delay. |
From the sidelines, a few observations:
|
blablabla... blablabla... blablabla... |
This PR is a rebase on
master
branch of @ivan-denysov work. It also contains some fixes to finalize the implementation. See #835 (comment)ping @codebycliff
it closes