OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
fix/cleanup indent in day.rb
Ivan Kuchin66c42fcef93e
diff --git a/app/models/day.rb b/app/models/day.rbindex 6c006389c79..51a1ab09395 100644--- a/app/models/day.rb+++ b/app/models/day.rb@@ -49,8 +49,8 @@ class Day < ApplicationRecordfrom = today.at_beginning_of_monthto = today.next_month.at_end_of_monthfrom_range(from:, to:)- .includes(:non_working_days)- .order("days.id")+ .includes(:non_working_days)+ .order("days.id")enddef self.from_range(from:, to:)@@ -61,20 +61,31 @@ class Day < ApplicationRecordfrom = from.to_dateto = to.to_date<<~SQL.squish- (SELECT- to_char(dd, 'YYYYMMDD')::integer id,- date_trunc('day', dd)::date date,- extract(isodow from dd) day_of_week,- (COALESCE(POSITION(extract(isodow from dd)::text IN settings.value) > 0, TRUE)- AND non_working_days.id IS NULL)::bool working- FROM- generate_series( '#{from}'::timestamp,+ (+ SELECT+ to_char(dd, 'YYYYMMDD')::integer id,+ date_trunc('day', dd)::date date,+ extract(isodow from dd) day_of_week,+ (+ COALESCE(+ POSITION(+ extract(isodow from dd)::text IN settings.value+ ) > 0,+ TRUE+ )+ AND+ non_working_days.id IS NULL+ )::bool working+ FROM+ generate_series(+ '#{from}'::timestamp,'#{to}'::timestamp,- '1 day'::interval) dd- LEFT JOIN settings- ON settings.name = 'working_days'- LEFT JOIN non_working_days- ON dd = non_working_days.date+ '1 day'::interval+ ) dd+ LEFT JOIN settings+ ON settings.name = 'working_days'+ LEFT JOIN non_working_days+ ON dd = non_working_days.date) daysSQLend