Skip to content

Commit

Permalink
Allow pass blank string to Order
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Aug 1, 2015
1 parent 85a682e commit f07216e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ func (s *search) Assign(attrs ...interface{}) *search {

func (s *search) Order(value string, reorder ...bool) *search {
if len(reorder) > 0 && reorder[0] {
s.orders = []string{value}
} else {
if value != "" {
s.orders = []string{value}
} else {
s.orders = []string{}
}
} else if value != "" {
s.orders = append(s.orders, value)
}
return s
Expand Down

0 comments on commit f07216e

Please sign in to comment.