[Feature][ActiveSupport] Adding `prepended` to ActiveSupport::Concern

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Feature][ActiveSupport] Adding `prepended` to ActiveSupport::Concern

Tom Prats
I was working with some concerns and ran into an issue with calling `super` from one and it led me on a wild goose chase trying to figure out if it was feasible or not. Long story short, it's actually pretty simple.

Instead of using `included do`, you can do something similar in to prepend the module. ActiveSupport::Concern handles everything when you use the `included` block so you don't actually have to add:

- append_features
- included
- class_methods

It seems like a pretty small step to add a `prepended` block that would handle `prepend_features` along with its dependencies. Is there any interest in having this be part of ActiveSupport::Concern? I would be interested in making a PR, but first I wanted to see if anyone had an argument against it.

Here's an old (rather short) discussion about it: https://groups.google.com/d/msg/rubyonrails-core/sSk9IEW74Ro/VNXhqg78hesJ

Thanks,
Tom

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.