Commit 7f6609d1 authored by fla's avatar fla

Remove old service keys in statistics.json

parent b0de3925
......@@ -8,8 +8,6 @@ class StatisticsPresenter
base_data.merge(user_counts)
.merge(post_counts)
.merge(comment_counts)
.merge(all_services)
.merge(legacy_services) # Remove in 0.6
end
def base_data
......@@ -95,28 +93,10 @@ class StatisticsPresenter
.count
end
def all_services_helper
result = {}
Configuration::KNOWN_SERVICES.each {|service, options|
result[service.to_s] = AppConfig.show_service?(service, nil)
}
result
end
def all_services
@all_services ||= all_services_helper
end
def available_services
Configuration::KNOWN_SERVICES.select {|service|
AppConfig.show_service?(service, nil)
}.map(&:to_s)
end
def legacy_services
Configuration::KNOWN_SERVICES.each_with_object({}) {|service, result|
result[service.to_s] = AppConfig.show_service?(service, nil)
}
end
end
......@@ -25,11 +25,7 @@ describe StatisticsPresenter do
"network" => "Diaspora",
"version" => AppConfig.version_string,
"registrations_open" => AppConfig.settings.enable_registrations?,
"services" => ["facebook"],
"facebook" => true,
"tumblr" => false,
"twitter" => false,
"wordpress" => false
"services" => ["facebook"]
)
end
......@@ -55,11 +51,7 @@ describe StatisticsPresenter do
"network" => "Diaspora",
"version" => AppConfig.version_string,
"registrations_open" => AppConfig.settings.enable_registrations?,
"services" => %w(twitter facebook),
"facebook" => true,
"twitter" => true,
"tumblr" => false,
"wordpress" => false
"services" => %w(twitter facebook)
)
end
end
......@@ -89,11 +81,7 @@ describe StatisticsPresenter do
"network" => "Diaspora",
"version" => AppConfig.version_string,
"registrations_open" => AppConfig.settings.enable_registrations?,
"services" => ["twitter"],
"facebook" => false,
"twitter" => true,
"tumblr" => false,
"wordpress" => false
"services" => ["twitter"]
)
end
end
......@@ -116,11 +104,7 @@ describe StatisticsPresenter do
"active_users_monthly" => User.monthly_actives.count,
"local_posts" => @presenter.local_posts,
"local_comments" => @presenter.local_comments,
"services" => ["facebook"],
"facebook" => true,
"twitter" => false,
"tumblr" => false,
"wordpress" => false
"services" => ["facebook"]
)
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment