Sha256: a72fe2800041bde828ff415ce3dd2dee3cfa37e92c753506629b9110cb4e5696

Contents?: true

Size: 825 Bytes

Versions: 49

Compression:

Stored size: 825 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'reactor/plans/common_attribute'

module Reactor
  module Plans
    class CreateAttribute < CommonAttribute
      def initialize(*args)
        super()
        (name, type), options = separate_arguments(*args)
        @name = name || options[:name]
        @type = type || options[:type]
        # Default values for attributes:
        # isSearchableInCM: false
        # isSearchableInTE: false
        set(:isSearchableInCM, 0)
        set(:isSearchableInTE, 0)
      end

      def prepare!
        error("name ist nil") if @name.nil?
        error("type is nil") if @type.nil?
        # TODO: Type check
        prepare_params!(nil)
      end

      def migrate!
        attrib = Reactor::Cm::Attribute.create(@name, @type)
        migrate_params!(attrib)
      end

    end
  end
end

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
infopark_reactor-1.26.1 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.26.0 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.25.2 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.25.1 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.25.0 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.24.1 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.24.0 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.23.1 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.23.0 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.23.0.beta2 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.22.6 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.22.5 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.22.4 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.22.3 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.22.2 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.22.1 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.22.0 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.21.0 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.20.4 lib/reactor/plans/create_attribute.rb
infopark_reactor-1.20.3 lib/reactor/plans/create_attribute.rb