diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-04 16:56:18 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-04 16:56:18 -0700 |
commit | e54d0da392119e75788f3d5a431b85e931a7e824 (patch) | |
tree | d2e3711db047060fb1e5db60dfc658949a697995 /store | |
parent | 58d0d9afd286afd715e9f04825e1305045d404e2 (diff) | |
download | chat-e54d0da392119e75788f3d5a431b85e931a7e824.tar.gz chat-e54d0da392119e75788f3d5a431b85e931a7e824.tar.bz2 chat-e54d0da392119e75788f3d5a431b85e931a7e824.zip |
Adding unit tests for cmd line
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_team_store.go | 14 | ||||
-rw-r--r-- | store/store.go | 1 |
2 files changed, 4 insertions, 11 deletions
diff --git a/store/sql_team_store.go b/store/sql_team_store.go index e9c205039..5351b98f3 100644 --- a/store/sql_team_store.go +++ b/store/sql_team_store.go @@ -35,10 +35,6 @@ func (s SqlTeamStore) CreateIndexesIfNotExists() { } func (s SqlTeamStore) Save(team *model.Team) StoreChannel { - return s.SaveWithValidate(team, true) -} - -func (s SqlTeamStore) SaveWithValidate(team *model.Team, validate bool) StoreChannel { storeChannel := make(StoreChannel) go func() { @@ -54,12 +50,10 @@ func (s SqlTeamStore) SaveWithValidate(team *model.Team, validate bool) StoreCha team.PreSave() - if validate { - if result.Err = team.IsValid(); result.Err != nil { - storeChannel <- result - close(storeChannel) - return - } + if result.Err = team.IsValid(); result.Err != nil { + storeChannel <- result + close(storeChannel) + return } if err := s.GetMaster().Insert(team); err != nil { diff --git a/store/store.go b/store/store.go index 2770dfd16..271caa366 100644 --- a/store/store.go +++ b/store/store.go @@ -39,7 +39,6 @@ type Store interface { type TeamStore interface { Save(team *model.Team) StoreChannel - SaveWithValidate(team *model.Team, validate bool) StoreChannel Update(team *model.Team) StoreChannel UpdateDisplayName(name string, teamId string) StoreChannel Get(id string) StoreChannel |