infopark_reactor 1.26.1 → 1.27.0.rc10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +25 -0
- data/.rubocop_todo.yml +363 -0
- data/Rakefile +10 -13
- data/app/models/rails_connector/abstract_obj.rb +2 -1
- data/config/routes.rb +0 -1
- data/infopark_reactor.gemspec +16 -15
- data/lib/generators/cm/migration/migration_generator.rb +4 -8
- data/lib/infopark_reactor.rb +43 -69
- data/lib/reactor/already_released.rb +1 -2
- data/lib/reactor/attributes.rb +92 -268
- data/lib/reactor/attributes/date_serializer.rb +23 -16
- data/lib/reactor/attributes/html_serializer.rb +6 -5
- data/lib/reactor/attributes/link_list_extender.rb +10 -8
- data/lib/reactor/attributes/link_list_from_accessor.rb +2 -1
- data/lib/reactor/attributes/link_list_from_attr_values.rb +2 -1
- data/lib/reactor/attributes/link_list_serializer.rb +8 -7
- data/lib/reactor/attributes_handlers.rb +164 -0
- data/lib/reactor/cache/permission.rb +6 -9
- data/lib/reactor/cache/user.rb +3 -6
- data/lib/reactor/cm/attribute.rb +16 -16
- data/lib/reactor/cm/attribute_group.rb +18 -21
- data/lib/reactor/cm/blob_too_small_error.rb +2 -2
- data/lib/reactor/cm/bridge.rb +6 -9
- data/lib/reactor/cm/channel.rb +3 -4
- data/lib/reactor/cm/editorial_group.rb +2 -9
- data/lib/reactor/cm/group.rb +30 -43
- data/lib/reactor/cm/job.rb +23 -25
- data/lib/reactor/cm/language.rb +21 -22
- data/lib/reactor/cm/link.rb +38 -40
- data/lib/reactor/cm/live_group.rb +2 -9
- data/lib/reactor/cm/log_entry.rb +22 -21
- data/lib/reactor/cm/missing_credentials.rb +3 -2
- data/lib/reactor/cm/multi_xml_request.rb +22 -25
- data/lib/reactor/cm/obj.rb +159 -154
- data/lib/reactor/cm/obj_class.rb +52 -51
- data/lib/reactor/cm/object_base.rb +26 -21
- data/lib/reactor/cm/permissions.rb +7 -7
- data/lib/reactor/cm/user.rb +43 -51
- data/lib/reactor/cm/workflow.rb +11 -12
- data/lib/reactor/cm/xml_attribute.rb +10 -19
- data/lib/reactor/cm/xml_markup.rb +7 -10
- data/lib/reactor/cm/xml_multi_request_error.rb +1 -3
- data/lib/reactor/cm/xml_request.rb +21 -29
- data/lib/reactor/cm/xml_request_error.rb +1 -3
- data/lib/reactor/cm/xml_response.rb +8 -16
- data/lib/reactor/cm/xml_single_request_error.rb +3 -5
- data/lib/reactor/configuration.rb +1 -3
- data/lib/reactor/engine.rb +5 -10
- data/lib/reactor/legacy.rb +6 -7
- data/lib/reactor/link/external.rb +8 -5
- data/lib/reactor/link/internal.rb +8 -5
- data/lib/reactor/link/temporary_link.rb +16 -17
- data/lib/reactor/main.rb +11 -15
- data/lib/reactor/migration.rb +52 -53
- data/lib/reactor/no_working_version.rb +1 -2
- data/lib/reactor/not_permitted.rb +1 -2
- data/lib/reactor/permission.rb +36 -38
- data/lib/reactor/persistence.rb +107 -179
- data/lib/reactor/plans/common_attribute.rb +7 -7
- data/lib/reactor/plans/common_attribute_group.rb +6 -6
- data/lib/reactor/plans/common_channel.rb +6 -6
- data/lib/reactor/plans/common_group.rb +7 -14
- data/lib/reactor/plans/common_job.rb +6 -6
- data/lib/reactor/plans/common_obj_class.rb +11 -11
- data/lib/reactor/plans/create_attribute.rb +1 -3
- data/lib/reactor/plans/create_attribute_group.rb +1 -3
- data/lib/reactor/plans/create_channel.rb +2 -3
- data/lib/reactor/plans/create_group.rb +3 -10
- data/lib/reactor/plans/create_job.rb +3 -4
- data/lib/reactor/plans/create_obj.rb +12 -14
- data/lib/reactor/plans/create_obj_class.rb +1 -2
- data/lib/reactor/plans/delete_attribute.rb +1 -3
- data/lib/reactor/plans/delete_attribute_group.rb +2 -4
- data/lib/reactor/plans/delete_channel.rb +3 -6
- data/lib/reactor/plans/delete_group.rb +2 -9
- data/lib/reactor/plans/delete_job.rb +3 -5
- data/lib/reactor/plans/delete_obj.rb +3 -4
- data/lib/reactor/plans/delete_obj_class.rb +1 -2
- data/lib/reactor/plans/prepared.rb +3 -4
- data/lib/reactor/plans/rename_group.rb +4 -11
- data/lib/reactor/plans/rename_obj_class.rb +1 -2
- data/lib/reactor/plans/update_attribute.rb +1 -3
- data/lib/reactor/plans/update_attribute_group.rb +2 -4
- data/lib/reactor/plans/update_group.rb +2 -9
- data/lib/reactor/plans/update_job.rb +4 -8
- data/lib/reactor/plans/update_obj.rb +6 -7
- data/lib/reactor/plans/update_obj_class.rb +0 -2
- data/lib/reactor/rc_independent.rb +0 -1
- data/lib/reactor/session.rb +27 -31
- data/lib/reactor/session/observers.rb +3 -5
- data/lib/reactor/session/user.rb +6 -7
- data/lib/reactor/session_helper/auth_filter.rb +9 -0
- data/lib/reactor/session_helper/auth_helper.rb +24 -0
- data/lib/reactor/session_helper/rsession_helper.rb +16 -0
- data/lib/reactor/session_helper/session_state.rb +31 -0
- data/lib/reactor/streaming_upload.rb +0 -1
- data/lib/reactor/sudo.rb +2 -3
- data/lib/reactor/support/link_matcher.rb +8 -7
- data/lib/reactor/tools/migrator.rb +30 -35
- data/lib/reactor/tools/response_handler/xml_attribute.rb +27 -33
- data/lib/reactor/tools/smart_xml_logger.rb +20 -22
- data/lib/reactor/tools/sower.rb +22 -23
- data/lib/reactor/tools/uploader.rb +12 -17
- data/lib/reactor/tools/versioner.rb +29 -30
- data/lib/reactor/tools/where_query.rb +11 -14
- data/lib/reactor/tools/workflow_generator.rb +26 -28
- data/lib/reactor/tools/xml_attributes.rb +7 -14
- data/lib/reactor/tools/xpath_extractor.rb +2 -1
- data/lib/reactor/validations.rb +20 -16
- data/lib/reactor/version.rb +1 -2
- data/lib/reactor/workflow.rb +10 -33
- data/lib/reactor/workflow/comment.rb +28 -0
- data/lib/reactor/workflow/empty.rb +0 -1
- data/lib/reactor/workflow/standard.rb +4 -3
- data/lib/tasks/cm_migrate.rake +3 -3
- data/lib/tasks/cm_seeds.rake +9 -16
- metadata +72 -36
- data/app/models/rails_connector/abstract_model.rb +0 -7
- data/app/models/rails_connector/attribute.rb +0 -94
- data/app/models/rails_connector/blob_mapping.rb +0 -16
- data/app/models/rails_connector/channel.rb +0 -41
- data/app/models/rails_connector/content.rb +0 -12
- data/app/models/rails_connector/job.rb +0 -14
- data/app/models/rails_connector/obj_class.rb +0 -158
- data/app/models/rails_connector/obj_class_attr.rb +0 -5
- data/app/models/rails_connector/object_with_meta_data.rb +0 -18
- data/lib/rails_connector/meta/eager_loader.rb +0 -91
- data/lib/reactor/rails_connector_meta.rb +0 -149
- 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 =
|
8
|
-
|
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
|
-
|
24
|
-
|
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 =
|
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
|
-
|
36
|
-
|
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
|
-
|
23
|
-
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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!(
|
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 =
|
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
|
-
|
23
|
-
|
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 =
|
8
|
-
|
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,
|
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
|
-
|
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!(
|
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
|
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
|
-
|
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
|
-
|
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,16 +1,12 @@
|
|
1
|
-
|
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,
|
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(
|
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
|
-
|
2
|
-
require
|
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
|
-
|
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"
|
23
|
-
|
24
|
-
|
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
|
-
|
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
|
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,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")
|
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
|
-
|
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")
|
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
|