ActiveRecord Patter for accessing Database