Skip to content

Commit

Permalink
Rename sendStats config setting to send_stats.
Browse files Browse the repository at this point in the history
For a more consistent code base, I renamed the settings->stats->sendStats
config key to send_stats. I think we should follow the rule:
Within the Erlang world, use underscores as separator, for the
outside world (JSON and POST parameters) use CamelCase.

Change-Id: Ifecb0351ef20af51a12e2bd1e88c87aeed586cfd
Reviewed-on: http://review.membase.org/6435
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information
vmx authored and alk committed May 27, 2011
1 parent adf6ac2 commit 0cddbe1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/menelaus_web.erl
Expand Up @@ -902,10 +902,12 @@ handle_settings_stats(Req) ->

build_settings_stats() ->
Defaults = default_settings_stats_config(),
ns_config:search_prop(ns_config:get(), settings, stats, Defaults).
[{send_stats, SendStats}] = ns_config:search_prop(
ns_config:get(), settings, stats, Defaults),
[{sendStats, SendStats}].

default_settings_stats_config() ->
[{sendStats, false}].
[{send_stats, false}].

handle_settings_stats_post(Req) ->
PostArgs = Req:parse_post(),
Expand All @@ -915,7 +917,7 @@ handle_settings_stats_post(Req) ->
Req:respond({400, add_header(),
"The value of \"sendStats\" must be true or false."});
SendStats2 ->
ns_config:set(settings, [{stats, [{sendStats, SendStats2}]}]),
ns_config:set(settings, [{stats, [{send_stats, SendStats2}]}]),
Req:respond({200, add_header(), []})
end.

Expand Down

0 comments on commit 0cddbe1

Please sign in to comment.