diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-23 01:50:15 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 18:33:05 +0300 |
commit | 1fe7501b49f896b74102c4b970310aa9ae34da85 (patch) | |
tree | ce271afb0fbaaa14291c1dc9009cd7815ee25463 /lib/ci/charts.rb | |
parent | bdbc7d967a0c3d95d5e4ea19a2a5be41268d3540 (diff) |
Revert "Prefer leading style for Style/DotPosition"
This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
Diffstat (limited to 'lib/ci/charts.rb')
-rw-r--r-- | lib/ci/charts.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/ci/charts.rb b/lib/ci/charts.rb index 6063d6f45e8..3decc3b1a26 100644 --- a/lib/ci/charts.rb +++ b/lib/ci/charts.rb @@ -2,10 +2,10 @@ module Ci module Charts module DailyInterval def grouped_count(query) - query - .group("DATE(#{Ci::Build.table_name}.created_at)") - .count(:created_at) - .transform_keys { |date| date.strftime(@format) } + query. + group("DATE(#{Ci::Build.table_name}.created_at)"). + count(:created_at). + transform_keys { |date| date.strftime(@format) } end def interval_step @@ -16,14 +16,14 @@ module Ci module MonthlyInterval def grouped_count(query) if Gitlab::Database.postgresql? - query - .group("to_char(#{Ci::Build.table_name}.created_at, '01 Month YYYY')") - .count(:created_at) - .transform_keys(&:squish) + query. + group("to_char(#{Ci::Build.table_name}.created_at, '01 Month YYYY')"). + count(:created_at). + transform_keys(&:squish) else - query - .group("DATE_FORMAT(#{Ci::Build.table_name}.created_at, '01 %M %Y')") - .count(:created_at) + query. + group("DATE_FORMAT(#{Ci::Build.table_name}.created_at, '01 %M %Y')"). + count(:created_at) end end @@ -46,8 +46,8 @@ module Ci end def collect - query = project.builds - .where("? > #{Ci::Build.table_name}.created_at AND #{Ci::Build.table_name}.created_at > ?", @to, @from) + query = project.builds. + where("? > #{Ci::Build.table_name}.created_at AND #{Ci::Build.table_name}.created_at > ?", @to, @from) totals_count = grouped_count(query) success_count = grouped_count(query.success) |