aboutsummaryrefslogtreecommitdiff
path: root/src/guff/site-model.cr
blob: ecde8319acde82c79a836d5fc2d83f54c2917fa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Guff
  class SiteModel < Model
    SQL = TemplateCache.new({
      get_default: "
        SELECT site_id
          FROM sites
         WHERE is_default
         LIMIT 1
      ",
    })

    def initialize(models : Models)
      super(models, SQL)
    end

    def get_default
      one(:get_default, nil, {} of String => String)
    end

    def to_site(host : String?)
      # TODO
      get_default
    end
  end
end