Skip to content

Commit

Permalink
fixe typo
Browse files Browse the repository at this point in the history
  • Loading branch information
juliengroch committed Jan 18, 2017
1 parent 6c57430 commit 5a209f1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const (
// DefaultCursorKeyName is the request cursor key name.
DefaultCursorKeyName = "since"

// DefaultCursorBddName is the default cursor bdd field name
DefaultCursorBddName = "id"
// DefaultCursorDBName is the default cursor bdd field name
DefaultCursorDBName = "id"

// DefaultCursorStructName is the default cursor struct field name
DefaultCursorStructName = "ID"
Expand Down
6 changes: 3 additions & 3 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ type Options struct {
CursorMode string
// CursorKeyName is the query string key name for the offset.
CursorKeyName string
// CursorBddName is the cursor bdd field name
CursorBddName string
// CursorDBName is the cursor bdd field name
CursorDBName string
// CursorStructName is the cursor struct field name
CursorStructName string
// CursorReverse turn true to work with DESC request
Expand All @@ -34,7 +34,7 @@ func NewOptions() *Options {
OffsetKeyName: DefaultOffsetKeyName,
CursorMode: IDModeCursor,
CursorKeyName: DefaultCursorKeyName,
CursorBddName: DefaultCursorBddName,
CursorDBName: DefaultCursorDBName,
CursorStructName: DefaultCursorStructName,
CursorReverse: false,
}
Expand Down
4 changes: 2 additions & 2 deletions paginator.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (p *PaginatorCursor) Page() (interface{}, error) {
p.Limit,
p.Cursor,
&p.Count,
p.Options.CursorBddName,
p.Options.CursorDBName,
p.Options.CursorReverse)
if err != nil {
return nil, err
Expand Down Expand Up @@ -118,7 +118,7 @@ func (p *PaginatorCursor) Next() (Paginator, error) {
paginator.Limit,
paginator.Cursor,
&paginator.Count,
paginator.Options.CursorBddName,
paginator.Options.CursorDBName,
paginator.Options.CursorReverse)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion stores.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *GORMStore) PaginateCursor(limit int64, cursor interface{}, count *int64
q = q.Find(s.items)
q = q.Limit(-1)

if err := q.Count(count).Error; err != nil {
if err := q.Unscoped().Count(count).Error; err != nil {
return err
}

Expand Down

0 comments on commit 5a209f1

Please sign in to comment.