Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 37 additions & 5 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions actions/actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package actions
import (
"testing"

"github.com/gobuffalo/packr"
"github.com/gobuffalo/packr/v2"
"github.com/gobuffalo/suite"
)

Expand All @@ -12,7 +12,7 @@ type ActionSuite struct {
}

func Test_ActionSuite(t *testing.T) {
action, err := suite.NewActionWithFixtures(App(), packr.NewBox("../fixtures"))
action, err := suite.NewActionWithFixtures(App(), packr.New("../fixtures", "../fixtures"))
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions actions/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"github.com/gobuffalo/envy"
forcessl "github.com/gobuffalo/mw-forcessl"
paramlogger "github.com/gobuffalo/mw-paramlogger"
"github.com/gobuffalo/packr/v2"
"github.com/unrolled/secure"

"github.com/akosgarai/buffalo_example/models"
"github.com/gobuffalo/buffalo-pop/pop/popmw"
csrf "github.com/gobuffalo/mw-csrf"
i18n "github.com/gobuffalo/mw-i18n"
"github.com/gobuffalo/packr"
)

// ENV is used to help switch settings based on where the
Expand Down Expand Up @@ -79,7 +79,7 @@ func App() *buffalo.App {
// for more information: https://gobuffalo.io/en/docs/localization
func translations() buffalo.MiddlewareFunc {
var err error
if T, err = i18n.New(packr.NewBox("../locales"), "en-US"); err != nil {
if T, err = i18n.New(packr.New("../locales", "../locales"), "en-US"); err != nil {
app.Stop(err)
}
return T.Middleware()
Expand Down
6 changes: 3 additions & 3 deletions actions/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ package actions

import (
"github.com/gobuffalo/buffalo/render"
"github.com/gobuffalo/packr"
"github.com/gobuffalo/packr/v2"

"github.com/akosgarai/buffalo_example/models"
)

var r *render.Engine
var assetsBox = packr.NewBox("../public")
var assetsBox = packr.New("../public", "../public")

func init() {
r = render.New(render.Options{
// HTML layout to be used for all HTML requests:
HTMLLayout: "application.html",

// Box containing all of the templates:
TemplatesBox: packr.NewBox("../templates"),
TemplatesBox: packr.New("../templates", "../templates"),
AssetsBox: assetsBox,

// Add template helpers here:
Expand Down
1 change: 1 addition & 0 deletions migrations/20190505130557_create_admin_roles.down.fizz
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
drop_table("admin_roles")
10 changes: 10 additions & 0 deletions migrations/20190505130557_create_admin_roles.up.fizz
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
create_table("admin_roles") {
t.Column("id", "uuid", {primary: true})
t.Column("label", "text", {})
t.Column("description", "text", {})
}
sql("insert into admin_roles (id, label, description) VALUES('a38ead89-39f1-443b-9326-1469949280a5','content_writer', 'Content writer administrator role');")
sql("insert into admin_roles (id, label, description) VALUES('228b837e-3ed4-4bf8-88d2-773e1710a46e','content_reviewer', 'Content reviewer administrator role');")
sql("insert into admin_roles (id, label, description) VALUES('9d337253-ff93-4445-a30b-3772e8bcd0cf','user_moderator', 'User moderator administrator administrator role');")
sql("insert into admin_roles (id, label, description) VALUES('54ea7725-a882-4e2c-88fd-6ee579b740b7','sys_admin', 'System administrator role');")
sql("insert into admin_roles (id, label, description) VALUES('268a0bb7-9151-4da0-9eb7-47874ce12e05','root', 'Root administrator role');")
14 changes: 14 additions & 0 deletions models/admin_role.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package models

import (
"github.com/gobuffalo/uuid"
)

type AdminRole struct {
ID uuid.UUID `json:"id" db:"id"`
Label string `json:"label" db:"label"`
Description string `json:"description" db:"description"`
}

// AdminRoles is not required by pop and may be deleted
type AdminRoles []AdminRole
7 changes: 7 additions & 0 deletions models/admin_role_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package models

import "testing"

func Test_AdminRole(t *testing.T) {
t.Skip("This test needs to be implemented!")
}
4 changes: 2 additions & 2 deletions models/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package models
import (
"testing"

"github.com/gobuffalo/packr"
"github.com/gobuffalo/packr/v2"
"github.com/gobuffalo/suite"
)

Expand All @@ -12,7 +12,7 @@ type ModelSuite struct {
}

func Test_ModelSuite(t *testing.T) {
model, err := suite.NewModelWithFixtures(packr.NewBox("../fixtures"))
model, err := suite.NewModelWithFixtures(packr.New("../fixtures", "../fixtures"))
if err != nil {
t.Fatal(err)
}
Expand Down