merefield
(Robert)
November 11, 2020, 10:11pm
6
Haha, well that’s one way of doing it, but really you should append it as an option, and always give the user the option to change it … at least if you want this to be merged into the plugin
But yeah, good stuff, keep evolving it.
btw, also take a look at:
I’ve been running into a bunch of instances recently of needing to override existing ruby methods from plugins, and thought I’d share my best practices here.
Overriding an instance method
class ::TopicQuery
module BabbleDefaultResults
def default_results(options={})
super(options).where('archetype <> ?', Archetype.chat)
end
end
prepend BabbleDefaultResults
end
Here I’m removing chat topics from an instance method which is returning a list of topics.
The module name BabbleD…
3 Likes