lib/ki/modules/restrictions.rb in ki-0.4.11 vs lib/ki/modules/restrictions.rb in ki-0.4.12

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Ki class Model module Restrictions def forbidden_actions [] @@ -26,12 +28,13 @@ end private def generic_restriction(method_name, attributes) - [:define_method, :define_singleton_method].each do |definition_means| + attributes += send(method_name) if defined? method_name + %i[define_method define_singleton_method].each do |definition_means| send definition_means, method_name do - attributes + attributes.sort.uniq end end end end end