Activerecord patterns

Related to issue #63. Needing tests.