merefield
(Robert)
11 Noviembre, 2020 22:11
6
Jaja, bueno, esa es una forma de hacerlo, pero en realidad deberías agregarlo como una opción y siempre darle al usuario la posibilidad de cambiarlo… al menos si quieres que esto se integre en el plugin
Pero sí, buen trabajo, sigue evolucionándolo.
Por cierto, también echa un vistazo a:
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…