erp_work_effort 3.1.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/app/controllers/erp_work_effort/erp_app/organizer/tasks/base_controller.rb +13 -0
- data/app/controllers/erp_work_effort/erp_app/organizer/tasks/work_efforts_controller.rb +128 -0
- data/app/models/associated_transportation_route.rb +12 -0
- data/app/models/associated_work_effort.rb +12 -0
- data/app/models/deliverable.rb +7 -0
- data/app/models/deliverable_type.rb +9 -0
- data/app/models/extensions/party.rb +0 -2
- data/app/models/good_type.rb +11 -0
- data/app/models/party_fixed_asset_assignment.rb +12 -0
- data/app/models/party_skill.rb +6 -0
- data/app/models/requirement.rb +14 -0
- data/app/models/requirement_party_role.rb +8 -0
- data/app/models/requirement_type.rb +7 -0
- data/app/models/skill_type.rb +10 -0
- data/app/models/transportation_route.rb +71 -0
- data/app/models/transportation_route_segment.rb +9 -0
- data/app/models/transportation_route_stop.rb +6 -0
- data/app/models/work_effort.rb +82 -92
- data/app/models/work_effort_association.rb +16 -0
- data/app/models/work_effort_association_type.rb +14 -0
- data/app/models/work_effort_deliverable_produced.rb +6 -0
- data/app/models/work_effort_fixed_asset_assignment.rb +10 -0
- data/app/models/work_effort_fixed_asset_serviced.rb +6 -0
- data/app/models/work_effort_fixed_asset_standard.rb +7 -0
- data/app/models/work_effort_good_standard.rb +7 -0
- data/app/models/work_effort_inventory_assignment.rb +10 -0
- data/app/models/work_effort_inventory_produced.rb +7 -0
- data/app/models/work_effort_party_assignment.rb +12 -0
- data/app/models/work_effort_purpose_type.rb +11 -0
- data/app/models/work_effort_skill_standard.rb +7 -0
- data/app/models/work_effort_type.rb +9 -0
- data/app/models/work_effort_type_association.rb +10 -0
- data/app/models/work_order_item.rb +5 -0
- data/app/models/work_order_item_fulfillment.rb +11 -0
- data/app/models/work_requirement_fulfillment.rb +3 -0
- data/config/routes.rb +20 -0
- data/db/data_migrations/20131213151309_create_tasks_organizer_application.rb +14 -0
- data/db/data_migrations/20131215225329_add_task_work_effort_types.rb +11 -0
- data/db/data_migrations/20131215234936_add_task_statuses.rb +21 -0
- data/db/migrate/20100220000000_base_work_efforts.rb +506 -103
- data/db/migrate/20130829153419_base_routes.rb +93 -0
- data/db/migrate/20131213140617_add_work_effort_role_assignments.rb +16 -0
- data/db/migrate/20131213144223_add_work_item_to_work_effort.rb +8 -0
- data/db/migrate/20140106184615_update_work_effort_item_id_to_int.rb +27 -0
- data/lib/erp_work_effort.rb +1 -1
- data/lib/erp_work_effort/engine.rb +7 -5
- data/lib/erp_work_effort/extensions.rb +2 -4
- data/lib/erp_work_effort/extensions/active_record/acts_as_routable.rb +55 -0
- data/lib/erp_work_effort/extensions/active_record/acts_as_work_effort.rb +66 -0
- data/lib/erp_work_effort/version.rb +7 -3
- data/spec/models/deliverable_spec.rb +5 -0
- data/spec/models/deliverable_type_spec.rb +5 -0
- data/spec/models/facility_spec.rb +8 -0
- data/spec/models/facility_type_spec.rb +8 -0
- data/spec/models/fixed_asset_party_role_spec.rb +5 -0
- data/spec/models/fixed_asset_spec.rb +5 -0
- data/spec/models/fixed_asset_type_spec.rb +5 -0
- data/spec/models/good_type_spec.rb +5 -0
- data/spec/models/party_fixed_asset_assignment_spec.rb +5 -0
- data/spec/models/party_skill_spec.rb +5 -0
- data/spec/models/requirement_party_role_spec.rb +5 -0
- data/spec/models/requirement_spec.rb +5 -0
- data/spec/models/requirement_type_spec.rb +5 -0
- data/spec/models/skill_type_spec.rb +8 -0
- data/spec/models/work_effort_association_spec.rb +5 -0
- data/spec/models/work_effort_association_type_spec.rb +5 -0
- data/spec/models/work_effort_deliverable_produced_spec.rb +5 -0
- data/spec/models/work_effort_fixed_asset_assignment_spec.rb +5 -0
- data/spec/models/work_effort_fixed_asset_serviced_spec.rb +5 -0
- data/spec/models/work_effort_fixed_asset_standard_spec.rb +5 -0
- data/spec/models/work_effort_good_standard_spec.rb +5 -0
- data/spec/models/work_effort_inventory_assignment_spec.rb +5 -0
- data/spec/models/work_effort_inventory_produced_spec.rb +5 -0
- data/spec/models/work_effort_party_assignment_spec.rb +5 -0
- data/spec/models/work_effort_purpose_type_spec.rb +5 -0
- data/spec/models/work_effort_skill_standard_spec.rb +5 -0
- data/spec/models/work_effort_spec.rb +49 -0
- data/spec/models/work_effort_type_association_spec.rb +5 -0
- data/spec/models/work_effort_type_spec.rb +5 -0
- data/spec/models/work_order_item_fulfillment_spec.rb +5 -0
- data/spec/models/work_order_item_spec.rb +29 -0
- data/spec/models/work_requirement_fulfillment_spec.rb +5 -0
- metadata +141 -105
- data/app/assets/javascripts/erp_work_effort/application.js +0 -9
- data/app/assets/stylesheets/erp_work_effort/application.css +0 -7
- data/app/controllers/erp_work_effort/application_controller.rb +0 -4
- data/app/helpers/erp_work_effort/application_helper.rb +0 -4
- data/app/models/cost.rb +0 -5
- data/app/models/project_effort.rb +0 -2
- data/app/models/project_requirement.rb +0 -2
- data/app/models/support_effort.rb +0 -2
- data/app/models/support_requirement.rb +0 -2
- data/app/models/work_effort_assignment.rb +0 -12
- data/app/models/work_effort_status.rb +0 -6
- data/app/models/work_effort_status_type.rb +0 -15
- data/app/models/work_requirement.rb +0 -78
- data/app/models/work_requirement_work_effort_status_type.rb +0 -6
- data/app/views/layouts/erp_work_effort/application.html.erb +0 -14
- data/lib/erp_work_effort/extensions/active_record/acts_as_project_effort.rb +0 -66
- data/lib/erp_work_effort/extensions/active_record/acts_as_project_requirement.rb +0 -64
- data/lib/erp_work_effort/extensions/active_record/acts_as_support_effort.rb +0 -61
- data/lib/erp_work_effort/extensions/active_record/acts_as_support_requirement.rb +0 -68
- data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +0 -15
- data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +0 -12
- data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +0 -19
- data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +0 -16
- data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +0 -12
- data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +0 -22
- data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +0 -20
- data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +0 -24
- data/spec/dummy/db/migrate/20130107204429_base_erp_services.erp_base_erp_svcs.rb +0 -461
- data/spec/dummy/db/migrate/20130107204430_base_work_efforts.erp_work_effort.rb +0 -211
- data/spec/dummy/db/migrate/20130107204431_base_tech_services.erp_tech_svcs.rb +0 -271
- data/spec/dummy/db/migrate/20130107204432_create_has_attribute_tables.erp_tech_svcs.rb +0 -39
- data/spec/dummy/db/migrate/20130107204433_create_groups.erp_tech_svcs.rb +0 -19
- data/spec/dummy/db/migrate/20130107204434_upgrade_security.erp_tech_svcs.rb +0 -54
- data/spec/dummy/db/migrate/20130107204435_upgrade_security2.erp_tech_svcs.rb +0 -270
- data/spec/dummy/db/schema.rb +0 -750
- data/spec/dummy/db/spec.sqlite3 +0 -0
- data/spec/models/cost_spec.rb +0 -11
- data/spec/models/project_effort_spec.rb +0 -11
- data/spec/models/project_requirement_spec.rb +0 -11
- data/spec/models/support_effort_spec.rb +0 -11
- data/spec/models/support_requirement_spec.rb +0 -11
- data/spec/models/valid_work_assignment_attribute_spec.rb +0 -11
- data/spec/models/valid_work_assignment_spec.rb +0 -11
- data/spec/models/work_effort_assignment_spec.rb +0 -13
- data/spec/models/work_effort_status_spec.rb +0 -11
- data/spec/models/work_effort_status_type_spec.rb +0 -11
- data/spec/models/work_requirement_spec.rb +0 -11
- data/spec/models/work_requirement_work_effort_status_type._spec.rb +0 -11
@@ -1,9 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
-
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
-
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
-
// the compiled file.
|
6
|
-
//
|
7
|
-
//= require jquery
|
8
|
-
//= require jquery_ujs
|
9
|
-
//= require_tree .
|
@@ -1,7 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
-
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
-
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
-
*= require_self
|
6
|
-
*= require_tree .
|
7
|
-
*/
|
data/app/models/cost.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
class WorkEffortAssignment < ActiveRecord::Base
|
2
|
-
attr_protected :created_at, :updated_at
|
3
|
-
|
4
|
-
belongs_to :work_effort
|
5
|
-
belongs_to :assigned_to, :polymorphic => true
|
6
|
-
belongs_to :assigned_by, :polymorphic => true
|
7
|
-
|
8
|
-
validates :assigned_to, :presence => {:message => 'Assigned to cannot be blank'}
|
9
|
-
validates :work_effort, :presence => {:message => 'Work effort cannot be blank'}
|
10
|
-
validates :assigned_by, :presence => {:message => 'Assinged by cannot be blank'}
|
11
|
-
|
12
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class WorkEffortStatusType < ActiveRecord::Base
|
2
|
-
attr_protected :created_at, :updated_at
|
3
|
-
|
4
|
-
has_many :work_effort_statuses
|
5
|
-
has_one :previous_status_type, :class_name => 'WorkEffortStatusType', :foreign_key => 'previous_status_id'
|
6
|
-
has_one :next_status_type, :class_name => 'WorkEffortStatusType', :foreign_key => 'next_status_id'
|
7
|
-
|
8
|
-
def status
|
9
|
-
description
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.iid(internal_identifier)
|
13
|
-
self.where('internal_identifier = ?', internal_identifier).first
|
14
|
-
end
|
15
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
class WorkRequirement < ActiveRecord::Base
|
2
|
-
attr_protected :created_at, :updated_at
|
3
|
-
|
4
|
-
acts_as_nested_set
|
5
|
-
include ErpTechSvcs::Utils::DefaultNestedSetMethods
|
6
|
-
|
7
|
-
belongs_to :work_requirement_record, :polymorphic => true
|
8
|
-
belongs_to :facility, :polymorphic => true
|
9
|
-
has_many :valid_work_assignments
|
10
|
-
has_many :work_requirement_work_effort_status_types, :dependent => :destroy
|
11
|
-
has_many :work_effort_status_types, :through => :work_requirement_work_effort_status_types
|
12
|
-
belongs_to :projected_cost, :class_name => "Cost", :foreign_key => 'cost_id'
|
13
|
-
|
14
|
-
def set_status_type_as_initial_status(status_type)
|
15
|
-
changing_status_type = self.work_effort_status_types.find_by_internal_identifier(status_type.internal_identifier)
|
16
|
-
unless changing_status_type.nil?
|
17
|
-
clear_initial_status_type
|
18
|
-
changed_status_type = self.work_requirement_work_effort_status_types.find(:first, :conditions => ["work_effort_status_type_id = ?", changing_status_type.id])
|
19
|
-
changed_status_type.is_initial_status = true
|
20
|
-
changed_status_type.save
|
21
|
-
else
|
22
|
-
raise "Work Requirement Does Not Contain Work Effort Status Type"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def add_status_type(status_type, is_initial_status=false)
|
27
|
-
status_rel = WorkRequirementWorkEffortStatusType.new
|
28
|
-
status_rel.work_effort_status_type = status_type
|
29
|
-
if is_initial_status
|
30
|
-
clear_initial_status_type
|
31
|
-
status_rel.is_initial_status = is_initial_status
|
32
|
-
end
|
33
|
-
status_rel.work_requirement = self
|
34
|
-
status_rel.save
|
35
|
-
end
|
36
|
-
|
37
|
-
def initial_work_effort_status_type
|
38
|
-
status_rel = get_initial_status_type
|
39
|
-
status_rel.nil? ? (raise "No Initial Status Set For Requirement") : status_rel.work_effort_status_type
|
40
|
-
end
|
41
|
-
|
42
|
-
def create_work_efforts(effort_class, initial_status_type=nil)
|
43
|
-
parent_effort = create_effort(effort_class, self)
|
44
|
-
self.children.each{ |req_child|
|
45
|
-
child_effort = create_effort(effort_class, req_child)
|
46
|
-
child_effort.work_effort.move_to_child_of(parent_effort.work_effort)
|
47
|
-
child_effort.save!
|
48
|
-
}
|
49
|
-
|
50
|
-
initial_status_type.nil? ? parent_effort.start(initial_work_effort_status_type) : parent_effort.start(initial_status_type)
|
51
|
-
parent_effort
|
52
|
-
end
|
53
|
-
|
54
|
-
protected
|
55
|
-
def create_effort(effort_class, req)
|
56
|
-
effort = effort_class.new
|
57
|
-
|
58
|
-
effort.description = req.description
|
59
|
-
effort.projected_completion_time = req.projected_completion_time
|
60
|
-
effort.projected_cost = req.projected_cost
|
61
|
-
effort.facility = req.facility
|
62
|
-
effort.save!
|
63
|
-
|
64
|
-
effort
|
65
|
-
end
|
66
|
-
|
67
|
-
def clear_initial_status_type
|
68
|
-
initial_status_type = get_initial_status_type
|
69
|
-
unless initial_status_type.nil?
|
70
|
-
initial_status_type.is_initial_status = false
|
71
|
-
initial_status_type.save
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def get_initial_status_type
|
76
|
-
work_requirement_work_effort_status_types.where('is_initial_status = 1').first
|
77
|
-
end
|
78
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>ErpWorkEffort</title>
|
5
|
-
<%= stylesheet_link_tag "erp_work_effort/application" %>
|
6
|
-
<%= javascript_include_tag "erp_work_effort/application" %>
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<%= yield %>
|
12
|
-
|
13
|
-
</body>
|
14
|
-
</html>
|
@@ -1,66 +0,0 @@
|
|
1
|
-
module ErpWorkEffort
|
2
|
-
module Extensions
|
3
|
-
module ActiveRecord
|
4
|
-
module ActsAsProjectEffort
|
5
|
-
|
6
|
-
def self.included(base)
|
7
|
-
base.extend(ClassMethods)
|
8
|
-
end
|
9
|
-
|
10
|
-
module ClassMethods
|
11
|
-
def acts_as_project_effort
|
12
|
-
extend ActsAsProjectEffort::SingletonMethods
|
13
|
-
include ActsAsProjectEffort::InstanceMethods
|
14
|
-
|
15
|
-
after_initialize :new_project_effort
|
16
|
-
after_update :save_project_effort
|
17
|
-
after_save :save_project_effort
|
18
|
-
after_destroy :destroy_project_effort
|
19
|
-
|
20
|
-
has_one :project_effort, :as => :work_effort_record
|
21
|
-
|
22
|
-
[
|
23
|
-
:description,
|
24
|
-
:description=,
|
25
|
-
:facility,
|
26
|
-
:facility=,
|
27
|
-
:work_effort_assignments,
|
28
|
-
:work_effort_statuses,
|
29
|
-
:projected_cost,
|
30
|
-
:projected_cost=,
|
31
|
-
:projected_completion_time,
|
32
|
-
:projected_completion_time=,
|
33
|
-
:actual_cost,
|
34
|
-
:start,
|
35
|
-
:started?,
|
36
|
-
:completed?,
|
37
|
-
:send_to_status
|
38
|
-
].each do |m| delegate m, :to => :project_effort end
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
module SingletonMethods
|
44
|
-
end
|
45
|
-
|
46
|
-
module InstanceMethods
|
47
|
-
def save_project_effort
|
48
|
-
self.project_effort.save
|
49
|
-
end
|
50
|
-
|
51
|
-
def destroy_project_effort
|
52
|
-
self.project_effort.destroy
|
53
|
-
end
|
54
|
-
|
55
|
-
def new_project_effort
|
56
|
-
if self.new_record? and self.project_effort.nil?
|
57
|
-
project_effort = ProjectEffort.new
|
58
|
-
self.project_effort = project_effort
|
59
|
-
project_effort.work_effort_record = self
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
module ErpWorkEffort
|
2
|
-
module Extensions
|
3
|
-
module ActiveRecord
|
4
|
-
module ActsAsProjectRequirement
|
5
|
-
|
6
|
-
def self.included(base)
|
7
|
-
base.extend(ClassMethods)
|
8
|
-
end
|
9
|
-
|
10
|
-
module ClassMethods
|
11
|
-
def acts_as_project_requirement
|
12
|
-
extend ActsAsProjectRequirement::SingletonMethods
|
13
|
-
include ActsAsProjectRequirement::InstanceMethods
|
14
|
-
|
15
|
-
after_initialize :new_project_requirement
|
16
|
-
after_update :save_project_requirement
|
17
|
-
after_save :save_project_requirement
|
18
|
-
after_destroy :destroy_project_requirement
|
19
|
-
|
20
|
-
has_one :project_requirement, :as => :work_requirement_record
|
21
|
-
|
22
|
-
[
|
23
|
-
:description,
|
24
|
-
:description=,
|
25
|
-
:facility,
|
26
|
-
:facility=,
|
27
|
-
:valid_work_assignments,
|
28
|
-
:work_requirement_work_effort_status_types,
|
29
|
-
:work_effort_status_types,
|
30
|
-
:projected_cost=,
|
31
|
-
:projected_cost,
|
32
|
-
:projected_completion_time,
|
33
|
-
:projected_completion_time=,
|
34
|
-
:add_status_type,
|
35
|
-
:add_status_type=
|
36
|
-
].each do |m| delegate m, :to => :project_requirement end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
module SingletonMethods
|
42
|
-
end
|
43
|
-
|
44
|
-
module InstanceMethods
|
45
|
-
def save_project_requirement
|
46
|
-
self.project_requirement.save
|
47
|
-
end
|
48
|
-
|
49
|
-
def destroy_project_requirement
|
50
|
-
self.project_requirement.destroy
|
51
|
-
end
|
52
|
-
|
53
|
-
def new_project_requirement
|
54
|
-
if (self.project_requirement.nil?)
|
55
|
-
project_requirement = ProjectRequirement.new
|
56
|
-
self.project_requirement = project_requirement
|
57
|
-
project_requirement.work_requirement_record = self
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
module ErpWorkEffort
|
2
|
-
module Extensions
|
3
|
-
module ActiveRecord
|
4
|
-
module ActsAsSupportEffort
|
5
|
-
|
6
|
-
def self.included(base)
|
7
|
-
base.extend(ClassMethods)
|
8
|
-
end
|
9
|
-
|
10
|
-
module ClassMethods
|
11
|
-
def acts_as_support_effort
|
12
|
-
extend ActsAsSupportEffort::SingletonMethods
|
13
|
-
include ActsAsSupportEffort::InstanceMethods
|
14
|
-
|
15
|
-
after_initialize :new_support_effort
|
16
|
-
after_update :save_support_effort
|
17
|
-
after_save :save_support_effort
|
18
|
-
after_destroy :destroy_support_effort
|
19
|
-
|
20
|
-
has_one :support_effort, :as => :work_effort_record
|
21
|
-
|
22
|
-
[
|
23
|
-
:facility,
|
24
|
-
:facility=,
|
25
|
-
:work_effort_assignments,
|
26
|
-
:work_effort_statuses,
|
27
|
-
:projected_cost,
|
28
|
-
:actual_cost
|
29
|
-
].each do |m| delegate m, :to => :support_effort end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
module SingletonMethods
|
35
|
-
end
|
36
|
-
|
37
|
-
module InstanceMethods
|
38
|
-
def method_missing(name, *args)
|
39
|
-
self.support_effort.respond_to?(name) ? self.support_effort.send(name, *args) : super
|
40
|
-
end
|
41
|
-
|
42
|
-
def save_support_effort
|
43
|
-
self.support_effort.save
|
44
|
-
end
|
45
|
-
|
46
|
-
def destroy_support_effort
|
47
|
-
self.support_effort.destroy
|
48
|
-
end
|
49
|
-
|
50
|
-
def new_support_effort
|
51
|
-
if self.new_record? and self.support_effort.nil?
|
52
|
-
support_effort = SupportEffort.new
|
53
|
-
self.support_effort = support_effort
|
54
|
-
support_effort.work_effort_record = self
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
module ErpWorkEffort
|
2
|
-
module Extensions
|
3
|
-
module ActiveRecord
|
4
|
-
module ActsAsSupportRequirement
|
5
|
-
|
6
|
-
def self.included(base)
|
7
|
-
base.extend(ClassMethods)
|
8
|
-
end
|
9
|
-
|
10
|
-
module ClassMethods
|
11
|
-
def acts_as_support_requirement
|
12
|
-
extend ActsAsSupportRequirement::SingletonMethods
|
13
|
-
include ActsAsSupportRequirement::InstanceMethods
|
14
|
-
|
15
|
-
after_initialize :new_support_requirement
|
16
|
-
after_update :save_support_requirement
|
17
|
-
after_save :save_support_requirement
|
18
|
-
after_destroy :destroy_support_requirement
|
19
|
-
|
20
|
-
has_one :support_requirement, :as => :work_requirement_record
|
21
|
-
|
22
|
-
[
|
23
|
-
:description,
|
24
|
-
:description=,
|
25
|
-
:facility,
|
26
|
-
:facility=,
|
27
|
-
:valid_work_assignments,
|
28
|
-
:work_requirement_work_effort_status_types,
|
29
|
-
:work_effort_status_types,
|
30
|
-
:projected_cost=,
|
31
|
-
:projected_cost,
|
32
|
-
:projected_completion_time,
|
33
|
-
:projected_completion_time=,
|
34
|
-
:add_status_type,
|
35
|
-
:add_status_type=
|
36
|
-
].each do |m| delegate m, :to => :support_requirement end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
module SingletonMethods
|
42
|
-
end
|
43
|
-
|
44
|
-
module InstanceMethods
|
45
|
-
def method_missing(name, *args)
|
46
|
-
self.support_requirement.respond_to?(name) ? self.support_requirement.send(name, *args) : super
|
47
|
-
end
|
48
|
-
|
49
|
-
def save_support_requirement
|
50
|
-
self.support_requirement.save
|
51
|
-
end
|
52
|
-
|
53
|
-
def destroy_support_requirement
|
54
|
-
self.support_requirement.destroy
|
55
|
-
end
|
56
|
-
|
57
|
-
def new_support_requirement
|
58
|
-
if self.new_record? and self.support_requirement.nil?
|
59
|
-
support_requirement = SupportEffort.new
|
60
|
-
self.support_requirement = support_requirement
|
61
|
-
support_requirement.work_requirement_record = self
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|