Created
December 31, 2011 15:49
-
-
Save mrmonday/7faf1013f81ea96bfb89 to your computer and use it in GitHub Desktop.
Bug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module example.controllers.HomeController; | |
import serenity.core.Controller; | |
class HomeController : Controller { | |
mixin register!(HomeController); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module example.models.HomeModel; | |
import serenity.core.Model; | |
struct Article { | |
ulong id; | |
} | |
class HomeModel : Model { | |
private SqlitePersister!Article mArticles; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Controller { | |
mixin template register(T : Controller) { | |
enum _s_pkg = __traits(parent, __traits(parent, __traits(parent, T))).stringof["package ".length .. $]; | |
enum _s_model = T.stringof[0 .. $-`Controller`.length] ~ `Model`; | |
mixin(q{enum _ = is(} ~ _s_pkg ~ q{.models.} ~ _s_model ~ q{.} ~ _s_model ~ q{ : serenity.core.Model.Model);}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SqlitePersister(T) { | |
static assert(T.tupleof.length > 0, T.stringof ~ `(` ~ (T.tupleof.length + '0') ~ `): ` ~ T.tupleof.stringof); | |
} | |
class Model {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment