Idempotent alias_method_chain
Dinked around today to deal with stack overflow problems when alias_method_chain
gets invoked more than once due to re-loading issues.
https://gist.github.com/4235378
tl;dr:
alias_method_chain :foo, :bar unless instance_methods.include? :foo_without_bar
Written by chrismo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#