aboutsummaryrefslogtreecommitdiff
path: root/src/guff/post-model.cr
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-03-07 00:00:32 -0500
committerPaul Duncan <pabs@pablotron.org>2016-03-07 00:00:32 -0500
commitfbb979af779341ed15c0c4d9d08ec52eaebb1037 (patch)
tree9cf11f1cbc9d1a9ae4fc1579aeb865770ec44d27 /src/guff/post-model.cr
parentf0f87c439037715cac407004e2220c678d96757a (diff)
downloadold-guff-fbb979af779341ed15c0c4d9d08ec52eaebb1037.tar.bz2
old-guff-fbb979af779341ed15c0c4d9d08ec52eaebb1037.zip
add site-model, misc fixes
Diffstat (limited to 'src/guff/post-model.cr')
-rw-r--r--src/guff/post-model.cr11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/guff/post-model.cr b/src/guff/post-model.cr
index 4e2bf63..4a3f406 100644
--- a/src/guff/post-model.cr
+++ b/src/guff/post-model.cr
@@ -65,19 +65,21 @@ module Guff
}
def get_posts(
- site_id = nil : Int32?,
+ site_id = nil : Int?,
q = "" : String,
tags = [] of Array(String) : Array(Array(String)),
- page = 1 : Int32,
- limit = 20 : Int32,
+ page = 1 : Int,
+ limit = 20 : Int,
sort = "posted_at" : String,
dir = "desc" : String,
)
# build sql args
sql_args = {
- "site_id": "0" # (site_id || @models.default_site_id).to_s,
+ "site_id": (site_id || @models.site.get_default).to_s,
} of String => String
+ p tags
+
# build tmpl args
tmpl_args = {
# TODO
@@ -112,6 +114,7 @@ module Guff
end
private def get_tags_filter(tag_sets : Array(Array(String)))
+ p tag_sets
(tag_sets.size > 0) ? template(:tags, {
"sql": tag_sets.map { |tags|
template(:tags, {