diff options
Diffstat (limited to 'src/guff/models.cr')
-rw-r--r-- | src/guff/models.cr | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/guff/models.cr b/src/guff/models.cr index 24cc9f8..0e09752 100644 --- a/src/guff/models.cr +++ b/src/guff/models.cr @@ -1,10 +1,11 @@ require "./database" require "./database-updater" +require "./site-model" private macro define_model_getters(hash) {% for name, klass in hash %} - def {{ name.id }} - @cache[{{ name }}] ||= {{ klass.id }}.new(self) + def {{ name.id }} : {{ klass.id }} + (@cache[{{ name }}] ||= {{ klass.id }}.new(self)) as {{ klass.id }} end {% end %} end @@ -31,11 +32,7 @@ module Guff define_model_getters({ post: PostModel, tag: TagModel, + site: SiteModel, }) - - def default_site_id - # TODO - 0 - end end end |