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

15 views
Skip to first unread message

Tom Prats

unread,
Mar 9, 2018, 3:57:17 AM3/9/18
to Ruby on Rails: Core
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
Reply all
Reply to author
Forward
0 new messages