@cupakromer Here's the article I was referencing yesterday: I'm planning on giving a lightning talk on it @MadisonRuby
I love the value that method_missing provides; unfortunately, sometimes I get into trouble when I abuse the power Matz has bestowed upon me. If you've done much work with method_missing the following error message probably isn't foreign to you.SystemStackError: stack level too deep It's a painful message to see, as it's always problematic to debug. Given the inherent difficultly of debugging method_missing calls I thought it might be valuable to offer a few alternatives. As an example I'll use the valid_for_[a group] methods that Validatable exposes. The Validatable validations allow you to put your validations into groups.class User include Validatable attr_accessor :first_name, :last_name, :ssn validates_presence_of :first_name, :last_name, :ssn, :groups => :account_creation validates_presence_of :ssn, :groups => :persistence end Given the above User class you can expect...
Full article:
http://blog.jayfields.com/2007/05/ruby-methodmissing-alte...