Skip to content

Commit

Permalink
v2.0.3
Browse files Browse the repository at this point in the history
* Fixed issue with transient columns and the auto select of columns.
  • Loading branch information
doug-martin committed May 29, 2015
1 parent 604f721 commit 826d6b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.0.3

* Fixed issue with transient columns and the auto select of columns.

## v2.0.2

* Changed references to "github.com/doug-martin/goqu" to "gopkg.in/doug-martin/goqu.v2"
Expand Down
2 changes: 2 additions & 0 deletions dataset_select_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (me *datasetTest) TestSelect() {
Name string
Address string `db:"address"`
EmailAddress string `db:"email_address"`
FakeCol string `db:"-"`
}
sql, _, err = ds1.Select(&myStruct{}).ToSql()
assert.NoError(t, err)
Expand Down Expand Up @@ -125,6 +126,7 @@ func (me *datasetTest) TestSelectDistinct() {
Name string
Address string `db:"address"`
EmailAddress string `db:"email_address"`
FakeCol string `db:"-"`
}
sql, _, err = ds1.SelectDistinct(&myStruct{}).ToSql()
assert.NoError(t, err)
Expand Down
6 changes: 4 additions & 2 deletions expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ func cols(vals ...interface{}) ColumnList {
panic(err.Error())
}
var structCols []string
for key, _ := range cm {
structCols = append(structCols, key)
for key, col := range cm {
if !col.Transient {
structCols = append(structCols, key)
}
}
sort.Strings(structCols)
for _, col := range structCols {
Expand Down

0 comments on commit 826d6b1

Please sign in to comment.