remove unused method

pull/8250/head
ulferts 5 years ago
parent d6f73461bb
commit 5b5c110a77
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 9
      lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb
  2. 18
      lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/permissions.rb
  3. 2
      lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.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

@ -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

@ -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

Loading…
Cancel
Save