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
Replace plain SQL with dsl
Oliver Güntherb31726a25156
diff --git a/modules/meeting/app/models/meeting.rb b/modules/meeting/app/models/meeting.rbindex 590120ecd6e..58b362589eb 100644--- a/modules/meeting/app/models/meeting.rb+++ b/modules/meeting/app/models/meeting.rb@@ -113,18 +113,13 @@ class Meeting < ApplicationRecord### Cache key for detecting changes to be shown to the userdef changed_hash- sql = <<~SQL.squish- SELECT MAX(meeting_agenda_items.updated_at), MAX(meeting_sections.updated_at), MAX(meetings.lock_version) FROM meetings- LEFT JOIN meeting_agenda_items ON meeting_agenda_items.meeting_id = meetings.id- LEFT JOIN meeting_sections ON meeting_sections.meeting_id = meetings.id- WHERE meetings.id = :id- SQL-- parts = ActiveRecord::Base- .connection- .exec_query(OpenProject::SqlSanitization.sanitize(sql, id:))- .rows- .flatten+ parts = Meeting+ .unscoped+ .where(id:)+ .left_joins(:agenda_items, :sections)+ .pick(MeetingAgendaItem.arel_table[:updated_at].maximum, MeetingSection.arel_table[:updated_at].maximum)++ parts << lock_versionOpenProject::Cache::CacheKey.expand(parts)end