Moved getPrimaryKey(table) to ActiveRecord; Changed the responsible code in Model; Added tests for both