Metaprogramming Your ActiveRecord Objects at Runtime
I often store Ruby code in the fields of ActiveRecord object, giving me the ability to morph the system's behavior at runtime. Metaprogramming in the large , if you will. This is one of my favorite techniques in the Ruby on Rails sphere and one of the reasons I love working with dynamic languages. I'm not exactly recommending this technique to anyone, since it's akin to juggling live chainsaws. You especially don't want to architect an entire production system this way, since there are negative implications for peformance and testability. However, the implementations can be simple and a little bit here and there have gone a long way for me over the years.
Full article:
http://blog.obiefernandez.com/content/2012/02/metaprogram...