Sha256: e5071b8993a0011bd8783e7f01da0a42dd1d7d89760f441ff60d7ccc53c92f4f
Contents?: true
Size: 930 Bytes
Versions: 7
Compression:
Stored size: 930 Bytes
Contents
# frozen_string_literal: true require 'activemodel/associations' require 'eac_ruby_utils/core_ext' module EacRailsUtils module Patches module Rails52 class ActiveModelAssociationMethodFix common_constructor :method_name do perform end def original_method_new_name :"original_#{method_name}" end private def the_module ::EacRailsUtils::Models::TablelessAssociations::ClassMethods end def perform patch = self the_module.class_eval do alias_method patch.original_method_new_name, patch.method_name remove_method patch.method_name define_method patch.method_name do |name, scope = nil, **options, &extension| send(patch.original_method_new_name, name, scope, options, &extension) end end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems