summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-09-30 11:45:32 +0000
committerRémy Coutable <remy@rymai.me>2016-09-30 11:45:32 +0000
commita5972bbce689d27192683ad1b8475fb7756bf819 (patch)
tree8d6af9548bfa673f03373dbb36b2a4b36a91dd24 /lib
parent6591b594d4907be0c235a9c05e40ac5bbb995d94 (diff)
parentd16e1184befc0b724a7abccfdbe50b3fc8da4ed9 (diff)
downloadgitlab-ce-a5972bbce689d27192683ad1b8475fb7756bf819.tar.gz
Merge branch 'replace-alias_method_chain' into 'master'
Remove the "soon to be deprecated" `alias_method_chain` in favor of `Module#prepend`. ## Are there points in the code the reviewer needs to double check? Double check whether the behavior of `attr_encrypted_no_db_connection` is still the desired one. ## Why was this MR needed? The `alias_method_chain` becomes deprecated in Rails 5 in favor of the `Module#prepend` introduced in Ruby 2.0. This MR prevents future deprecated warnings in light of a possible Rails version bump. Closes #22302 See merge request !6570
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/task_list_filter.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/banzai/filter/task_list_filter.rb b/lib/banzai/filter/task_list_filter.rb
index 66608c9859c..4efbcaf5c7f 100644
--- a/lib/banzai/filter/task_list_filter.rb
+++ b/lib/banzai/filter/task_list_filter.rb
@@ -10,19 +10,21 @@ module Banzai
# task_list gem.
#
# See https://github.com/github/task_list/pull/60
- class TaskListFilter < TaskList::Filter
- def add_css_class_with_fix(node, *new_class_names)
+ module ClassNamesFilter
+ def add_css_class(node, *new_class_names)
if new_class_names.include?('task-list')
# Don't add class to all lists
return
elsif new_class_names.include?('task-list-item')
- add_css_class_without_fix(node.parent, 'task-list')
+ super(node.parent, 'task-list')
end
- add_css_class_without_fix(node, *new_class_names)
+ super(node, *new_class_names)
end
+ end
- alias_method_chain :add_css_class, :fix
+ class TaskListFilter < TaskList::Filter
+ prepend ClassNamesFilter
end
end
end