From 570acebeb5dded80f24e7b01ffddbec09c9eccb6 Mon Sep 17 00:00:00 2001 From: Tizian Schmidlin Date: Mon, 27 May 2019 15:07:00 +0200 Subject: [PATCH 1/2] Rename alias_method_chain `alias_method_chain` was removed in [Rails 5.1](https://apidock.com/rails/Module/alias_method_chain) and must be migrated to old_school `alias_method`. This makes the plugin work with Redmine 4.0 with Rails > 5.0 work again --- lib/clipboard_image_paste/attachment_patch.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/clipboard_image_paste/attachment_patch.rb b/lib/clipboard_image_paste/attachment_patch.rb index 5cfc7c0..70325b0 100644 --- a/lib/clipboard_image_paste/attachment_patch.rb +++ b/lib/clipboard_image_paste/attachment_patch.rb @@ -22,7 +22,9 @@ def self.included(base) unloadable #~ alias_method_chain :attach_files, :pasted_images - alias_method_chain :save_attachments, :pasted_images + #~ alias_method_chain :save_attachments, :pasted_images + alias_method :save_attachmenets_without_pasted_images, :save_attachments + alias_method :save_attachments, :save_attachments_with_pasted_images end end From 4af3d376103b525d644cbc5faabc5f54353853df Mon Sep 17 00:00:00 2001 From: Tizian Schmidlin Date: Mon, 27 May 2019 16:07:58 +0200 Subject: [PATCH 2/2] Fix typo --- lib/clipboard_image_paste/attachment_patch.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/clipboard_image_paste/attachment_patch.rb b/lib/clipboard_image_paste/attachment_patch.rb index 70325b0..a21748d 100644 --- a/lib/clipboard_image_paste/attachment_patch.rb +++ b/lib/clipboard_image_paste/attachment_patch.rb @@ -23,7 +23,7 @@ def self.included(base) #~ alias_method_chain :attach_files, :pasted_images #~ alias_method_chain :save_attachments, :pasted_images - alias_method :save_attachmenets_without_pasted_images, :save_attachments + alias_method :save_attachments_without_pasted_images, :save_attachments alias_method :save_attachments, :save_attachments_with_pasted_images end end