Skip to content

Commit

Permalink
Use model instead of handcrafted SQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
troyanov committed May 18, 2020
1 parent c36cbae commit 7af908d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (r *CasbinRule) String() string {
func (a *Adapter) LoadPolicy(model model.Model) error {
var lines []*CasbinRule

if _, err := a.db.Query(&lines, `SELECT * FROM casbin_rules`); err != nil {
if err := a.db.Model(&lines).Select(); err != nil {
return err
}

Expand Down

0 comments on commit 7af908d

Please sign in to comment.