Tag Archives: design

The Controversial Eval Function

eval is a function in Ruby that allows you to execute arbitrary code. You pass in a string containing code, and voila! It’s very useful, for things like holding pointers of a sort to functions; but it’s also dangerous, because script-kiddies can format your hard-drive. So what’s the middle-path use-case of eval? Continue reading

Posted in Development | Tagged , , | 2 Comments

Extending Acts_as_Authenticated

acts_as_authenticated is a pretty sweet plugin for managing users. But extending it proves to be a bit of a challenge. In this article, we discuss two approaches: adding methods and fields to the existing User class, and subclassing User. Subclassing separates the code from the core User code. We use single table inheritance to achieve this lofty goal. Continue reading

Posted in Development, Gems and Plugins | Tagged , | Comments Off