Sha256: 3e9671a89120174334a617f8a2fea4fde19b0c9fa43f98927cbd0d0d5b653254

Contents?: true

Size: 604 Bytes

Versions: 8

Compression:

Stored size: 604 Bytes

Contents

module Reactor
  module Plans
    class RenameObjClass
      include Prepared

      def initialize(*args)
        (from, to), options = separate_arguments(*args)
        @from = from || options[:from]
        @to = to || options[:to]
      end

      def prepare!
        error("from is nil") if @from.nil?
        error("to is nil") if @to.nil?
        error("from does not exist") unless Reactor::Cm::ObjClass.exists?(@from)
        error("to does exist") if Reactor::Cm::ObjClass.exists?(@to)
      end

      def migrate!
        Reactor::Cm::ObjClass.rename(@from, @to)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
infopark_reactor-1.29.1 lib/reactor/plans/rename_obj_class.rb
infopark_reactor-1.29.0 lib/reactor/plans/rename_obj_class.rb
infopark_reactor-1.28.0 lib/reactor/plans/rename_obj_class.rb
infopark_reactor-1.27.0.rc10 lib/reactor/plans/rename_obj_class.rb
infopark_reactor-1.27.0.rc9 lib/reactor/plans/rename_obj_class.rb
infopark_reactor-1.27.0.rc8 lib/reactor/plans/rename_obj_class.rb
infopark_reactor-1.27.0.rc7 lib/reactor/plans/rename_obj_class.rb
infopark_reactor-1.27.0.rc4 lib/reactor/plans/rename_obj_class.rb