From 974d7c1d8ae71d50566dc8c2857520dde139a191 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Fri, 1 Apr 2016 15:57:49 -0400 Subject: update TODO --- TODO.md | 5 +++++ src/guff/models/role.cr | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/guff/models/role.cr diff --git a/TODO.md b/TODO.md index 9874b78..23329bc 100644 --- a/TODO.md +++ b/TODO.md @@ -10,6 +10,11 @@ TODO * configurable dashboard (like wordpress, choose modules, columns, layout) * user password strength +* expires\_at for posts + +Projects +-------- +* webhook support: https://developer.github.com/v3/repos/hooks/#create-a-hook Editors ------- diff --git a/src/guff/models/role.cr b/src/guff/models/role.cr new file mode 100644 index 0000000..9faf6b2 --- /dev/null +++ b/src/guff/models/role.cr @@ -0,0 +1,28 @@ +class Guff::RoleModel < Guff::Model + SQL = TemplateCache.new({ + get_roles: " + SELECT role_id, + role_name, + role_desc + + FROM roles + + -- FIXME + ORDER BY role_id + ", + }) + + def initialize(models : Models) + super(models, SQL) + end + + def get_roles + r = [] of Hash(String, SQLite3::Value) + + all(:get_roles, nil, nil) do |row| + r << row + end + + r + end +end -- cgit v1.2.3