From 200044418768a2325bda16e01b99ea54c5efaec0 Mon Sep 17 00:00:00 2001 From: Alexandr Panko Date: Thu, 28 Nov 2019 23:51:22 +0300 Subject: [PATCH] Get rid of of alias_method_chain. --- lib/easy_roles.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/easy_roles.rb b/lib/easy_roles.rb index 5b1974a..8c9b1d9 100644 --- a/lib/easy_roles.rb +++ b/lib/easy_roles.rb @@ -4,8 +4,12 @@ module EasyRoles extend ActiveSupport::Concern included do |base| - base.send :alias_method_chain, :method_missing, :roles - base.send :alias_method_chain, :respond_to?, :roles + base.class_eval do + alias_method :method_missing_without_roles, :method_missing + alias_method :method_missing, :method_missing_with_roles + alias_method :respond_to_without_roles?, :respond_to? + alias_method :respond_to?, :respond_to_with_roles? + end end ALLOWED_METHODS = [:serialize, :bitmask]