sql procedures provided instead of ruby-written logics