Class: Reactor::Plans::DeleteAttributeGroup
- Inherits:
-
CommonAttributeGroup
- Object
- CommonAttributeGroup
- Reactor::Plans::DeleteAttributeGroup
- Defined in:
- lib/reactor/plans/delete_attribute_group.rb
Constant Summary
Constants inherited from CommonAttributeGroup
CommonAttributeGroup::ALLOWED_PARAMS
Instance Method Summary collapse
-
#initialize(*args) ⇒ DeleteAttributeGroup
constructor
A new instance of DeleteAttributeGroup.
- #migrate! ⇒ Object
- #prepare! ⇒ Object
Methods inherited from CommonAttributeGroup
#add_attributes, #remove_attributes, #set
Methods included from Prepared
Constructor Details
#initialize(*args) ⇒ DeleteAttributeGroup
Returns a new instance of DeleteAttributeGroup.
6 7 8 9 10 11 12 |
# File 'lib/reactor/plans/delete_attribute_group.rb', line 6 def initialize(*args) super() (obj_class, name), = separate_arguments(*args) @name = name || [:name] @obj_class = obj_class || [:obj_class] @pk = "#{@obj_class}.#{@name}" end |
Instance Method Details
#migrate! ⇒ Object
20 21 22 23 |
# File 'lib/reactor/plans/delete_attribute_group.rb', line 20 def migrate! attrib = Reactor::Cm::AttributeGroup.get(@pk) attrib.delete! end |
#prepare! ⇒ Object
14 15 16 17 18 |
# File 'lib/reactor/plans/delete_attribute_group.rb', line 14 def prepare! error("name ist nil") if @name.nil? error("obj_class is nil") if @obj_class.nil? error("attribute group #{@pk} does not exist") unless Reactor::Cm::AttributeGroup.exists?(@pk) end |