« Unexpected behavior with rspec-rails, nesting contexts, before blocks, and ActiveRecord | Main | X-Cascade header in Rails »

2011.03.31

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Got some interesting feedback on Freenode IRC #ruby about this post. There is a way to block subsequent modules from overriding methods in ruby 1.9+ using alias_method. In my case I still wanted access to both mixin methods, so it's not quite applicable, but a cool tip nonetheless.

http://banisterfiend.wordpress.com/2010/11/04/baking-module-methods-into-classes-with-alias_method/

Good post. We've learned to favor composition over inheritance. You point out a benefit to composition over mixing-in.

The comments to this entry are closed.