From 6d7d892af79826c138ae33724c689d7c400bb79a Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Wed, 6 Nov 2013 22:20:26 +0800 Subject: [PATCH] Update README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index fafc3ff0..083010e1 100644 --- a/README.md +++ b/README.md @@ -600,6 +600,14 @@ type Cart struct { func (c Cart) TableName() string { return "shopping_cart" } + +func (u User) TableName() string { + if u.Role == "admin" { + return "admin_users" + } else { + return "users" + } +} ``` ## Run Raw SQl