diff options
author | Chris <ccbrown112@gmail.com> | 2017-10-06 11:08:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 11:08:59 -0700 |
commit | 70e5f00241473c27a3008959ce08832c75e76ba8 (patch) | |
tree | 3afd074964c9220cc4a87210286a13dfd38c61d0 /store/sqlstore/preference_store.go | |
parent | d1958bdc49cd10277ca2e27bb2eea499c5994954 (diff) | |
download | chat-70e5f00241473c27a3008959ce08832c75e76ba8.tar.gz chat-70e5f00241473c27a3008959ce08832c75e76ba8.tar.bz2 chat-70e5f00241473c27a3008959ce08832c75e76ba8.zip |
store/storetest package (#7588)
* prerequisites
* storetest package
Diffstat (limited to 'store/sqlstore/preference_store.go')
-rw-r--r-- | store/sqlstore/preference_store.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/store/sqlstore/preference_store.go b/store/sqlstore/preference_store.go index 6765a74f8..ddd1fc268 100644 --- a/store/sqlstore/preference_store.go +++ b/store/sqlstore/preference_store.go @@ -18,10 +18,6 @@ type SqlPreferenceStore struct { SqlStore } -const ( - FEATURE_TOGGLE_PREFIX = "feature_enabled_" -) - func NewSqlPreferenceStore(sqlStore SqlStore) store.PreferenceStore { s := &SqlPreferenceStore{sqlStore} @@ -50,7 +46,7 @@ func (s SqlPreferenceStore) DeleteUnusedFeatures() { WHERE Category = :Category AND Value = :Value - AND Name LIKE '` + FEATURE_TOGGLE_PREFIX + `%'` + AND Name LIKE '` + store.FEATURE_TOGGLE_PREFIX + `%'` queryParams := map[string]string{ "Category": model.PREFERENCE_CATEGORY_ADVANCED_SETTINGS, @@ -246,7 +242,7 @@ func (s SqlPreferenceStore) IsFeatureEnabled(feature, userId string) store.Store WHERE UserId = :UserId AND Category = :Category - AND Name = :Name`, map[string]interface{}{"UserId": userId, "Category": model.PREFERENCE_CATEGORY_ADVANCED_SETTINGS, "Name": FEATURE_TOGGLE_PREFIX + feature}); err != nil { + AND Name = :Name`, map[string]interface{}{"UserId": userId, "Category": model.PREFERENCE_CATEGORY_ADVANCED_SETTINGS, "Name": store.FEATURE_TOGGLE_PREFIX + feature}); err != nil { result.Err = model.NewAppError("SqlPreferenceStore.IsFeatureEnabled", "store.sql_preference.is_feature_enabled.app_error", nil, err.Error(), http.StatusInternalServerError) } else { result.Data = value == "true" |