Skip to content

Commit

Permalink
chore: remove daily statistic limit
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Jul 8, 2020
1 parent a5b74f0 commit 600cc31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/daily_statistics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class DailyStatisticsController < ApplicationController
before_action :validate_query_params, only: :show

def show
daily_statistics = DailyStatistic.order(:created_at_unixtimestamp).limit(365)
daily_statistics = DailyStatistic.order(:created_at_unixtimestamp)
render json: DailyStatisticSerializer.new(daily_statistics, { params: { indicator: params[:id] } })
end

Expand Down
3 changes: 2 additions & 1 deletion test/controllers/api/v1/daily_statistics_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class DailyStatisticsControllerTest < ActionDispatch::IntegrationTest
end

test "should return addresses count and timestamp" do
daily_statistic_data = create_list(:daily_statistic, 15)
create_list(:daily_statistic, 15)
daily_statistic_data = DailyStatistic.order(:created_at_unixtimestamp)
valid_get api_v1_daily_statistic_url("addresses_count")

assert_equal [%w(addresses_count created_at_unixtimestamp).sort], json.dig("data").map { |item| item.dig("attributes").keys.sort }.uniq
Expand Down

0 comments on commit 600cc31

Please sign in to comment.