infopark_reactor 1.26.1 → 1.27.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +25 -0
  3. data/.rubocop_todo.yml +363 -0
  4. data/Rakefile +10 -13
  5. data/app/models/rails_connector/abstract_obj.rb +2 -1
  6. data/config/routes.rb +0 -1
  7. data/infopark_reactor.gemspec +16 -15
  8. data/lib/generators/cm/migration/migration_generator.rb +4 -8
  9. data/lib/infopark_reactor.rb +43 -69
  10. data/lib/reactor/already_released.rb +1 -2
  11. data/lib/reactor/attributes.rb +92 -268
  12. data/lib/reactor/attributes/date_serializer.rb +20 -16
  13. data/lib/reactor/attributes/html_serializer.rb +6 -5
  14. data/lib/reactor/attributes/link_list_extender.rb +10 -8
  15. data/lib/reactor/attributes/link_list_from_accessor.rb +2 -1
  16. data/lib/reactor/attributes/link_list_from_attr_values.rb +2 -1
  17. data/lib/reactor/attributes/link_list_serializer.rb +8 -7
  18. data/lib/reactor/attributes_handlers.rb +164 -0
  19. data/lib/reactor/cache/permission.rb +6 -9
  20. data/lib/reactor/cache/user.rb +3 -6
  21. data/lib/reactor/cm/attribute.rb +16 -16
  22. data/lib/reactor/cm/attribute_group.rb +18 -21
  23. data/lib/reactor/cm/blob_too_small_error.rb +2 -2
  24. data/lib/reactor/cm/bridge.rb +6 -9
  25. data/lib/reactor/cm/channel.rb +3 -4
  26. data/lib/reactor/cm/editorial_group.rb +2 -9
  27. data/lib/reactor/cm/group.rb +30 -43
  28. data/lib/reactor/cm/job.rb +23 -25
  29. data/lib/reactor/cm/language.rb +21 -22
  30. data/lib/reactor/cm/link.rb +38 -40
  31. data/lib/reactor/cm/live_group.rb +2 -9
  32. data/lib/reactor/cm/log_entry.rb +22 -21
  33. data/lib/reactor/cm/missing_credentials.rb +3 -2
  34. data/lib/reactor/cm/multi_xml_request.rb +22 -25
  35. data/lib/reactor/cm/obj.rb +159 -154
  36. data/lib/reactor/cm/obj_class.rb +52 -51
  37. data/lib/reactor/cm/object_base.rb +26 -21
  38. data/lib/reactor/cm/permissions.rb +7 -7
  39. data/lib/reactor/cm/user.rb +43 -51
  40. data/lib/reactor/cm/workflow.rb +11 -12
  41. data/lib/reactor/cm/xml_attribute.rb +10 -19
  42. data/lib/reactor/cm/xml_markup.rb +7 -10
  43. data/lib/reactor/cm/xml_multi_request_error.rb +1 -3
  44. data/lib/reactor/cm/xml_request.rb +21 -29
  45. data/lib/reactor/cm/xml_request_error.rb +1 -3
  46. data/lib/reactor/cm/xml_response.rb +8 -16
  47. data/lib/reactor/cm/xml_single_request_error.rb +3 -5
  48. data/lib/reactor/configuration.rb +1 -3
  49. data/lib/reactor/engine.rb +5 -10
  50. data/lib/reactor/legacy.rb +6 -7
  51. data/lib/reactor/link/external.rb +8 -5
  52. data/lib/reactor/link/internal.rb +8 -5
  53. data/lib/reactor/link/temporary_link.rb +16 -17
  54. data/lib/reactor/main.rb +11 -15
  55. data/lib/reactor/migration.rb +52 -53
  56. data/lib/reactor/no_working_version.rb +1 -2
  57. data/lib/reactor/not_permitted.rb +1 -2
  58. data/lib/reactor/permission.rb +36 -38
  59. data/lib/reactor/persistence.rb +104 -178
  60. data/lib/reactor/plans/common_attribute.rb +7 -7
  61. data/lib/reactor/plans/common_attribute_group.rb +6 -6
  62. data/lib/reactor/plans/common_channel.rb +6 -6
  63. data/lib/reactor/plans/common_group.rb +7 -14
  64. data/lib/reactor/plans/common_job.rb +6 -6
  65. data/lib/reactor/plans/common_obj_class.rb +11 -11
  66. data/lib/reactor/plans/create_attribute.rb +1 -3
  67. data/lib/reactor/plans/create_attribute_group.rb +1 -3
  68. data/lib/reactor/plans/create_channel.rb +2 -3
  69. data/lib/reactor/plans/create_group.rb +3 -10
  70. data/lib/reactor/plans/create_job.rb +3 -4
  71. data/lib/reactor/plans/create_obj.rb +12 -14
  72. data/lib/reactor/plans/create_obj_class.rb +1 -2
  73. data/lib/reactor/plans/delete_attribute.rb +1 -3
  74. data/lib/reactor/plans/delete_attribute_group.rb +2 -4
  75. data/lib/reactor/plans/delete_channel.rb +3 -6
  76. data/lib/reactor/plans/delete_group.rb +2 -9
  77. data/lib/reactor/plans/delete_job.rb +3 -5
  78. data/lib/reactor/plans/delete_obj.rb +3 -4
  79. data/lib/reactor/plans/delete_obj_class.rb +1 -2
  80. data/lib/reactor/plans/prepared.rb +3 -4
  81. data/lib/reactor/plans/rename_group.rb +4 -11
  82. data/lib/reactor/plans/rename_obj_class.rb +1 -2
  83. data/lib/reactor/plans/update_attribute.rb +1 -3
  84. data/lib/reactor/plans/update_attribute_group.rb +2 -4
  85. data/lib/reactor/plans/update_group.rb +2 -9
  86. data/lib/reactor/plans/update_job.rb +4 -8
  87. data/lib/reactor/plans/update_obj.rb +6 -7
  88. data/lib/reactor/plans/update_obj_class.rb +0 -2
  89. data/lib/reactor/rc_independent.rb +0 -1
  90. data/lib/reactor/session.rb +27 -31
  91. data/lib/reactor/session/observers.rb +3 -5
  92. data/lib/reactor/session/user.rb +6 -7
  93. data/lib/reactor/session_helper/auth_filter.rb +9 -0
  94. data/lib/reactor/session_helper/auth_helper.rb +24 -0
  95. data/lib/reactor/session_helper/rsession_helper.rb +16 -0
  96. data/lib/reactor/session_helper/session_state.rb +31 -0
  97. data/lib/reactor/streaming_upload.rb +0 -1
  98. data/lib/reactor/sudo.rb +2 -3
  99. data/lib/reactor/support/link_matcher.rb +8 -7
  100. data/lib/reactor/tools/migrator.rb +30 -35
  101. data/lib/reactor/tools/response_handler/xml_attribute.rb +27 -33
  102. data/lib/reactor/tools/smart_xml_logger.rb +20 -22
  103. data/lib/reactor/tools/sower.rb +22 -23
  104. data/lib/reactor/tools/uploader.rb +12 -17
  105. data/lib/reactor/tools/versioner.rb +29 -30
  106. data/lib/reactor/tools/where_query.rb +11 -14
  107. data/lib/reactor/tools/workflow_generator.rb +26 -28
  108. data/lib/reactor/tools/xml_attributes.rb +7 -14
  109. data/lib/reactor/tools/xpath_extractor.rb +2 -1
  110. data/lib/reactor/validations.rb +20 -16
  111. data/lib/reactor/version.rb +1 -2
  112. data/lib/reactor/workflow.rb +10 -33
  113. data/lib/reactor/workflow/comment.rb +28 -0
  114. data/lib/reactor/workflow/empty.rb +0 -1
  115. data/lib/reactor/workflow/standard.rb +4 -3
  116. data/lib/tasks/cm_migrate.rake +3 -3
  117. data/lib/tasks/cm_seeds.rake +9 -16
  118. metadata +64 -28
  119. data/app/models/rails_connector/abstract_model.rb +0 -7
  120. data/app/models/rails_connector/attribute.rb +0 -94
  121. data/app/models/rails_connector/blob_mapping.rb +0 -16
  122. data/app/models/rails_connector/channel.rb +0 -41
  123. data/app/models/rails_connector/content.rb +0 -12
  124. data/app/models/rails_connector/job.rb +0 -14
  125. data/app/models/rails_connector/obj_class.rb +0 -158
  126. data/app/models/rails_connector/obj_class_attr.rb +0 -5
  127. data/app/models/rails_connector/object_with_meta_data.rb +0 -18
  128. data/lib/rails_connector/meta/eager_loader.rb +0 -91
  129. data/lib/reactor/rails_connector_meta.rb +0 -149
  130. data/lib/reactor/session_helper.rb +0 -72
@@ -1,17 +1,16 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
2
  module Plans
4
3
  class CommonAttribute
5
4
  include Prepared
6
5
 
7
- ALLOWED_PARAMS = [:callback, :helpText, :maxSize, :minSize,
8
- :title, :values]
6
+ ALLOWED_PARAMS = %i(callback helpText maxSize minSize
7
+ title values).freeze
9
8
 
10
9
  def initialize
11
10
  @params = {}
12
11
  end
13
12
 
14
- def set(key,value)
13
+ def set(key, value)
15
14
  @params[key.to_sym] = value
16
15
  end
17
16
 
@@ -20,12 +19,13 @@ module Reactor
20
19
  end
21
20
 
22
21
  protected
23
- def prepare_params!(attribute=nil)
24
- @params.keys.each{|k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k}
22
+
23
+ def prepare_params!(_attribute = nil)
24
+ @params.keys.each { |k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k }
25
25
  end
26
26
 
27
27
  def migrate_params!(attribute)
28
- @params.each{|k,v|attribute.set(k,v)}
28
+ @params.each { |k, v| attribute.set(k, v) }
29
29
  attribute.save!
30
30
  end
31
31
  end
@@ -1,16 +1,15 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
2
  module Plans
4
3
  class CommonAttributeGroup
5
4
  include Prepared
6
5
 
7
- ALLOWED_PARAMS = [:title, :index]
6
+ ALLOWED_PARAMS = %i(title index).freeze
8
7
 
9
8
  def initialize
10
9
  @params = {}
11
10
  end
12
11
 
13
- def set(key,value)
12
+ def set(key, value)
14
13
  key = key.to_sym
15
14
  if key == :attributes
16
15
  @attributes = value
@@ -32,8 +31,9 @@ module Reactor
32
31
  end
33
32
 
34
33
  protected
35
- def prepare_params!(attribute=nil)
36
- @params.keys.each{|k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k}
34
+
35
+ def prepare_params!(_attribute = nil)
36
+ @params.keys.each { |k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k }
37
37
  end
38
38
 
39
39
  def migrate_params!(attribute)
@@ -44,7 +44,7 @@ module Reactor
44
44
  attribute.remove_attributes(previous_attributes)
45
45
  attribute.add_attributes(@attributes)
46
46
  end
47
- @params.each{|k,v|attribute.set(k,v)}
47
+ @params.each { |k, v| attribute.set(k, v) }
48
48
  attribute.save!
49
49
  end
50
50
  end
@@ -1,16 +1,15 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
2
  module Plans
4
3
  class CommonChannel
5
4
  include Prepared
6
5
 
7
- ALLOWED_PARAMS = [:title]
6
+ ALLOWED_PARAMS = [:title].freeze
8
7
 
9
8
  def initialize
10
9
  @params = {}
11
10
  end
12
11
 
13
- def set(key,value)
12
+ def set(key, value)
14
13
  @params[key.to_sym] = value
15
14
  end
16
15
 
@@ -19,12 +18,13 @@ module Reactor
19
18
  end
20
19
 
21
20
  protected
22
- def prepare_params!(channel=nil)
23
- @params.keys.each{|k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k}
21
+
22
+ def prepare_params!(_channel = nil)
23
+ @params.keys.each { |k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k }
24
24
  end
25
25
 
26
26
  def migrate_params!(channel)
27
- @params.each{|k,v|channel.send(:"#{k}=",v)}
27
+ @params.each { |k, v| channel.send(:"#{k}=", v) }
28
28
  channel.save!
29
29
  end
30
30
  end
@@ -1,18 +1,14 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
-
4
2
  module Plans
5
-
6
3
  class CommonGroup
7
-
8
4
  include Prepared
9
5
 
10
- ALLOWED_PARAMS = [
11
- :users,
12
- :global_permissions,
13
- :real_name,
14
- :owner,
15
- ]
6
+ ALLOWED_PARAMS = %i(
7
+ users
8
+ global_permissions
9
+ real_name
10
+ owner
11
+ ).freeze
16
12
 
17
13
  def initialize
18
14
  @params = {}
@@ -28,7 +24,7 @@ module Reactor
28
24
 
29
25
  protected
30
26
 
31
- def prepare_params!(group = nil)
27
+ def prepare_params!(_group = nil)
32
28
  @params.keys.each { |key| error("unknown parameter: #{key}") unless ALLOWED_PARAMS.include?(key) }
33
29
  end
34
30
 
@@ -37,9 +33,6 @@ module Reactor
37
33
 
38
34
  group.save!
39
35
  end
40
-
41
36
  end
42
-
43
37
  end
44
-
45
38
  end
@@ -1,16 +1,15 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
2
  module Plans
4
3
  class CommonJob
5
4
  include Prepared
6
5
 
7
- ALLOWED_PARAMS = [:title, :is_active, :comment, :exec_login, :exec_perm, :schedule, :script]
6
+ ALLOWED_PARAMS = %i(title is_active comment exec_login exec_perm schedule script).freeze
8
7
 
9
8
  def initialize
10
9
  @params = {}
11
10
  end
12
11
 
13
- def set(key,value)
12
+ def set(key, value)
14
13
  @params[key.to_sym] = value
15
14
  end
16
15
 
@@ -19,12 +18,13 @@ module Reactor
19
18
  end
20
19
 
21
20
  protected
22
- def prepare_params!(job=nil)
23
- @params.keys.each{|k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k}
21
+
22
+ def prepare_params!(_job = nil)
23
+ @params.keys.each { |k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k }
24
24
  end
25
25
 
26
26
  def migrate_params!(job)
27
- @params.each{|k,v|job.send(:"#{k}=",v)}
27
+ @params.each { |k, v| job.send(:"#{k}=", v) }
28
28
  job.save!
29
29
  end
30
30
  end
@@ -1,11 +1,10 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
2
  module Plans
4
3
  class CommonObjClass
5
4
  include Prepared
6
5
 
7
- ALLOWED_PARAMS = [:completionCheck, :isEnabled, :recordSetCallback, :title,
8
- :validContentTypes, :workflowModification]
6
+ ALLOWED_PARAMS = %i(completionCheck isEnabled recordSetCallback title
7
+ validContentTypes workflowModification).freeze
9
8
 
10
9
  def initialize
11
10
  @take_attrs = []
@@ -17,7 +16,7 @@ module Reactor
17
16
  @params_options = {}
18
17
  end
19
18
 
20
- def set(key, value, options={})
19
+ def set(key, value, options = {})
21
20
  @params_options[key.to_sym] = options
22
21
  @params[key.to_sym] = value
23
22
  end
@@ -26,7 +25,7 @@ module Reactor
26
25
  @preset_attrs[attribute] = value
27
26
  end
28
27
 
29
- def take(attr_name, opts={})
28
+ def take(attr_name, opts = {})
30
29
  attr_name = attr_name.to_s
31
30
  @take_attrs << attr_name
32
31
  @drop_attrs.delete(attr_name)
@@ -35,7 +34,7 @@ module Reactor
35
34
  @preset_attrs[attr_name] = opts[:preset] if opts.key? :preset
36
35
  end
37
36
 
38
- def drop(attr_name, opts={})
37
+ def drop(attr_name, _opts = {})
39
38
  attr_name = attr_name.to_s
40
39
  @drop_attrs << attr_name
41
40
  @take_attrs.delete(attr_name)
@@ -48,14 +47,15 @@ module Reactor
48
47
  end
49
48
 
50
49
  protected
51
- def prepare_attrs!(klass=nil)
50
+
51
+ def prepare_attrs!(_klass = nil)
52
52
  @take_attrs.each do |attr|
53
53
  error("attribute doesn't exist #{attr}") unless Reactor::Cm::Attribute.exists?(attr)
54
54
  end
55
55
  end
56
56
 
57
- def prepare_params!(klass=nil)
58
- @params.keys.each{|k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k}
57
+ def prepare_params!(_klass = nil)
58
+ @params.keys.each { |k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k }
59
59
  end
60
60
 
61
61
  def migrate_attrs!(klass)
@@ -65,8 +65,8 @@ module Reactor
65
65
  end
66
66
 
67
67
  def migrate_params!(klass)
68
- @params.each{|k,v|klass.set(k,v,@params_options[k])}
69
- klass.preset_attributes.merge(@preset_attrs).each{|k,v|klass.preset(k,v)}
68
+ @params.each { |k, v| klass.set(k, v, @params_options[k]) }
69
+ klass.preset_attributes.merge(@preset_attrs).each { |k, v| klass.preset(k, v) }
70
70
  klass.save!
71
71
  end
72
72
  end
@@ -1,5 +1,4 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'reactor/plans/common_attribute'
1
+ require "reactor/plans/common_attribute"
3
2
 
4
3
  module Reactor
5
4
  module Plans
@@ -27,7 +26,6 @@ module Reactor
27
26
  attrib = Reactor::Cm::Attribute.create(@name, @type)
28
27
  migrate_params!(attrib)
29
28
  end
30
-
31
29
  end
32
30
  end
33
31
  end
@@ -1,5 +1,4 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'reactor/plans/common_attribute_group'
1
+ require "reactor/plans/common_attribute_group"
3
2
 
4
3
  module Reactor
5
4
  module Plans
@@ -22,7 +21,6 @@ module Reactor
22
21
  attrib = Reactor::Cm::AttributeGroup.create(@obj_class, @name, @index)
23
22
  migrate_params!(attrib)
24
23
  end
25
-
26
24
  end
27
25
  end
28
26
  end
@@ -1,6 +1,5 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'reactor/cm/channel'
3
- require 'reactor/plans/common_channel'
1
+ require "reactor/cm/channel"
2
+ require "reactor/plans/common_channel"
4
3
 
5
4
  module Reactor
6
5
  module Plans
@@ -1,16 +1,12 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'reactor/plans/common_group'
1
+ require "reactor/plans/common_group"
3
2
 
4
3
  module Reactor
5
-
6
4
  module Plans
7
-
8
5
  class CreateGroup < CommonGroup
9
-
10
6
  def initialize(*args)
11
7
  super()
12
8
 
13
- (name, _), options = separate_arguments(*args)
9
+ (name,), options = separate_arguments(*args)
14
10
 
15
11
  @name = name || options[:name]
16
12
 
@@ -18,7 +14,7 @@ module Reactor
18
14
  end
19
15
 
20
16
  def prepare!
21
- error('name is nil') if @name.nil?
17
+ error("name is nil") if @name.nil?
22
18
  error("group #{@name} already exists") if Reactor::Cm::Group.exists?(@name)
23
19
 
24
20
  prepare_params!(nil)
@@ -27,9 +23,6 @@ module Reactor
27
23
  def migrate!
28
24
  Reactor::Cm::Group.create(@params)
29
25
  end
30
-
31
26
  end
32
-
33
27
  end
34
-
35
28
  end
@@ -1,6 +1,5 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'reactor/cm/job'
3
- require 'reactor/plans/common_job'
1
+ require "reactor/cm/job"
2
+ require "reactor/plans/common_job"
4
3
 
5
4
  module Reactor
6
5
  module Plans
@@ -16,7 +15,7 @@ module Reactor
16
15
  end
17
16
 
18
17
  def migrate!
19
- job = Reactor::Cm::Job.create(@name, @params)
18
+ Reactor::Cm::Job.create(@name, @params)
20
19
  end
21
20
  end
22
21
  end
@@ -1,13 +1,11 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
2
  module Plans
4
3
  class CreateObj
5
-
6
4
  def set(key, value)
7
5
  @attrs[key.to_sym] = value
8
6
  end
9
7
 
10
- def initialize(opts={})
8
+ def initialize(opts = {})
11
9
  @name = opts[:name]
12
10
  @parent = opts[:parent]
13
11
  @objClass = opts[:objClass]
@@ -19,22 +17,23 @@ module Reactor
19
17
  raise "#{self.class.name}: name is nil" if @name.nil?
20
18
  raise "#{self.class.name}: parent is nil" if @parent.nil?
21
19
  raise "#{self.class.name}: objClass is nil" if @objClass.nil?
22
- raise "#{self.class.name}: parent does not exist" if not Reactor::Cm::Obj.exists?(@parent)
23
- raise "#{self.class.name}: obj with name #{@name} already exists" if (!@ignoreExisting) && Reactor::Cm::Obj.exists?(path)
24
- =begin
25
- raise "#{self.class.name}: objClass #{@objClass} not found" if not Reactor::Cm::ObjClass.exists?(@objClass)
26
- @attrs.keys.each do |attr|
27
- raise "#{self.class.name}: attr #{attr} not found for objClass #{@objClass}" if not Reactor::Cm::ObjClass.has_attribute?(attr)
20
+ raise "#{self.class.name}: parent does not exist" unless Reactor::Cm::Obj.exists?(@parent)
21
+ if !@ignoreExisting && Reactor::Cm::Obj.exists?(path)
22
+ raise "#{self.class.name}: obj with name #{@name} already exists"
28
23
  end
29
- =end
24
+ # raise "#{self.class.name}: objClass #{@objClass} not found" if not Reactor::Cm::ObjClass.exists?(@objClass)
25
+ # @attrs.keys.each do |attr|
26
+ # raise "#{self.class.name}: attr #{attr} not found for objClass #{@objClass}" if not Reactor::Cm::ObjClass.has_attribute?(attr)
27
+ # end
30
28
  # ...?
31
29
  end
32
30
 
33
31
  def migrate!
34
- return true if (@ignoreExisting) && Reactor::Cm::Obj.exists?(path)
32
+ return true if @ignoreExisting && Reactor::Cm::Obj.exists?(path)
33
+
35
34
  @obj = Cm::Obj.create(@name, @parent, @objClass)
36
- @attrs.each do |key,value|
37
- @obj.set(key,value)
35
+ @attrs.each do |key, value|
36
+ @obj.set(key, value)
38
37
  end
39
38
  @obj.save!
40
39
  @obj.release!
@@ -43,7 +42,6 @@ module Reactor
43
42
  def path
44
43
  File.join(@parent, @name)
45
44
  end
46
-
47
45
  end
48
46
  end
49
47
  end
@@ -1,5 +1,4 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'reactor/plans/common_obj_class'
1
+ require "reactor/plans/common_obj_class"
3
2
 
4
3
  module Reactor
5
4
  module Plans
@@ -1,4 +1,3 @@
1
- # -*- encoding : utf-8 -*-
2
1
  module Reactor
3
2
  module Plans
4
3
  class DeleteAttribute < CommonAttribute
@@ -10,7 +9,7 @@ module Reactor
10
9
 
11
10
  def prepare!
12
11
  error("name is nil") if @name.nil?
13
- error("attribute #{@name} does not exist") if not Reactor::Cm::Attribute.exists?(@name)
12
+ error("attribute #{@name} does not exist") unless Reactor::Cm::Attribute.exists?(@name)
14
13
  # TODO: check used..
15
14
  end
16
15
 
@@ -18,7 +17,6 @@ module Reactor
18
17
  attrib = Reactor::Cm::Attribute.get(@name)
19
18
  attrib.delete!
20
19
  end
21
-
22
20
  end
23
21
  end
24
22
  end
@@ -1,5 +1,4 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'reactor/plans/common_attribute_group'
1
+ require "reactor/plans/common_attribute_group"
3
2
 
4
3
  module Reactor
5
4
  module Plans
@@ -15,14 +14,13 @@ module Reactor
15
14
  def prepare!
16
15
  error("name ist nil") if @name.nil?
17
16
  error("obj_class is nil") if @obj_class.nil?
18
- error("attribute group #{@pk} does not exist") if not Reactor::Cm::AttributeGroup.exists?(@pk)
17
+ error("attribute group #{@pk} does not exist") unless Reactor::Cm::AttributeGroup.exists?(@pk)
19
18
  end
20
19
 
21
20
  def migrate!
22
21
  attrib = Reactor::Cm::AttributeGroup.get(@pk)
23
22
  attrib.delete!
24
23
  end
25
-
26
24
  end
27
25
  end
28
26
  end