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
exclude virtual columns from journaling
Klaus Zanders3d827aedb595
diff --git a/app/models/journal/base_journal.rb b/app/models/journal/base_journal.rbindex ea9cd0fa094..826b7c62767 100644--- a/app/models/journal/base_journal.rb+++ b/app/models/journal/base_journal.rb@@ -37,7 +37,7 @@ class Journal::BaseJournal < ApplicationRecordenddef self.journaled_attributes- @journaled_attributes ||= column_names.map(&:to_sym) - excluded_attributes+ @journaled_attributes ||= columns.reject(&:virtual?).map { |col| col.name.to_sym } - excluded_attributesenddef self.excluded_attributesdiff --git a/spec/lib/acts_as_journalized/journaled_spec.rb b/spec/lib/acts_as_journalized/journaled_spec.rbindex c10c92e4cb2..66244f00add 100644--- a/spec/lib/acts_as_journalized/journaled_spec.rb+++ b/spec/lib/acts_as_journalized/journaled_spec.rb@@ -29,6 +29,14 @@require "spec_helper"RSpec.describe "Journalized Objects" do+ describe ".journaled_attributes" do+ it "does not include virtual columns" do+ # we do have generated columns in the time entry journal+ expect(Journal::TimeEntryJournal.journaled_attributes).not_to include(:start_timestamp)+ expect(Journal::TimeEntryJournal.journaled_attributes).not_to include(:end_timestamp)+ end+ end+describe "journal_editable_by?" docontext "when the journable is a work package" dolet!(:user) { create(:user, member_with_permissions: { project => [] }) }