refactored to use active-record style api
Merge pull request #3 from sandersonet/refactor

Refactored to use active-record style api