Skip to content

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

remove unused method

ulferts5b5c110a7787
diff --git a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb
index 0611c82d37b..25e1b7e0c60 100644
--- a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb
+++ b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb
@@ -190,15 +190,6 @@ module Redmine::Acts::Journalized
def activity_type
self.class.name.underscore.pluralize
end
-
- # Specifies the attributes used during journal creation. This is separated into its own
- # method so that it can be overridden by the VestalVersions::Users feature.
- def journal_attributes
- { journaled_id: id, activity_type: activity_type,
- details: journal_changes, version: last_version + 1,
- notes: journal_notes, user_id: (journal_user.try(:id) || User.current.try(:id))
- }.merge(extra_journal_attributes || {})
- end
end
end
end
diff --git a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/permissions.rb b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/permissions.rb
index adcd0fbff64..0413184cc9e 100644
--- a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/permissions.rb
+++ b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/permissions.rb
@@ -52,17 +52,23 @@ module Redmine::Acts::Journalized
# Is overridden if defined in the journalized model directly
def journal_editable_by?(user)
return true if user.admin?
+
if respond_to? :editable_by?
editable_by? user
else
- permission = if respond_to? :journal_permission
- journal_permission
- else
- :"edit_#{self.class.to_s.pluralize.underscore}"
- end
p = @project || (project if respond_to? :project)
options = { global: p.present? }
- user.allowed_to? permission, p, options
+ user.allowed_to? journable_edit_permission, p, options
+ end
+ end
+
+ private
+
+ def journable_edit_permission
+ if respond_to? :journal_permission
+ journal_permission
+ else
+ :"edit_#{self.class.to_s.pluralize.underscore}"
end
end
end
diff --git a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rb b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rb
index dbb6f9b4f6c..6802b946e20 100644
--- a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rb
+++ b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rb
@@ -59,7 +59,7 @@ module Redmine::Acts::Journalized
after_update { save_journals }
after_destroy :remove_journal_version
- attr_accessor :journal_notes, :journal_user, :extra_journal_attributes
+ attr_accessor :journal_notes, :journal_user
end
end