Sha256: beb7ee5dd43d2043c5ff0c138f24699ca371ba613ec0870cc0f9125ddc77604c
Contents?: true
Size: 688 Bytes
Versions: 9
Compression:
Stored size: 688 Bytes
Contents
# frozen_string_literal: true require 'adaptive_alias/patches/base' module AdaptiveAlias module Patches class ForwardPatch < Base def apply! AdaptiveAlias.current_patches[[@klass, @old_column, @new_column]] = self @klass.alias_attribute(@new_column, @old_column) add_hooks!(current_column: @old_column, alias_column: @new_column) end def remove! super @klass.remove_alias_attribute(@new_column) @klass.define_attribute_method(@new_column) new_patch = BackwardPatch.new(@klass, @old_column, @new_column) new_patch.apply! return new_patch end end end end
Version data entries
9 entries across 9 versions & 1 rubygems