erp_work_effort 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ class WorkEffort < ActiveRecord::Base
4
4
 
5
5
  belongs_to :work_effort_record, :polymorphic => true
6
6
  belongs_to :facility, :polymorphic => true
7
- belongs_to :work_effort_assignment
7
+ has_many :work_effort_assignments
8
8
  has_many :work_effort_statuses
9
9
 
10
10
  belongs_to :projected_cost, :class_name => 'Cost', :foreign_key => 'projected_cost_id'
@@ -118,7 +118,7 @@ class WorkEffort < ActiveRecord::Base
118
118
  end
119
119
 
120
120
  def complete_work_effort
121
- self.finished_at = DateTime.now
121
+ self.finished_at = Time.now
122
122
  self.actual_completion_time = time_diff_in_minutes(self.finished_at.to_time, self.started_at.to_time)
123
123
  self.save
124
124
  self.parent.start_effort unless self.parent.nil?
@@ -1,15 +1,10 @@
1
1
  class WorkEffortAssignment < ActiveRecord::Base
2
- has_one :work_effort
2
+ belongs_to :work_effort
3
3
  belongs_to :assigned_to, :polymorphic => true
4
4
  belongs_to :assigned_by, :polymorphic => true
5
5
 
6
- validates_presence_of :assigned_to, :work_effort, :assigned_by
6
+ validates :assigned_to, :presence => {:message => 'Assigned to cannot be blank'}
7
+ validates :work_effort, :presence => {:message => 'Work effort cannot be blank'}
8
+ validates :assigned_by, :presence => {:message => 'Assinged by cannot be blank'}
7
9
 
8
- def before_destroy
9
- unless self.work_effort.nil?
10
- self.work_effort.work_effort_assignment_id = nil
11
- self.work_effort.save
12
- end
13
- end
14
-
15
10
  end
@@ -1,4 +1,4 @@
1
1
  class WorkEffortStatus < ActiveRecord::Base
2
- belongs_to :work_effort, :dependent => :destroy
2
+ belongs_to :work_effort
3
3
  belongs_to :work_effort_status_type
4
4
  end
@@ -21,7 +21,6 @@ class BaseWorkEfforts < ActiveRecord::Migration
21
21
  t.string :work_effort_record_type
22
22
 
23
23
  #foreign keys
24
- t.integer :work_effort_assignment_id
25
24
  t.integer :projected_cost_id
26
25
  t.integer :actual_cost_id
27
26
 
@@ -33,7 +32,6 @@ class BaseWorkEfforts < ActiveRecord::Migration
33
32
 
34
33
  add_index :work_efforts, [:work_effort_record_id, :work_effort_record_type], :name => "work_effort_record_id_type"
35
34
  add_index :work_efforts, [:facility_type, :facility_id], :name => "facility"
36
- add_index :work_efforts, :work_effort_assignment_id
37
35
  add_index :work_efforts, :finished_at
38
36
  end
39
37
 
@@ -106,6 +104,9 @@ class BaseWorkEfforts < ActiveRecord::Migration
106
104
  ## work_effort_assignments
107
105
  unless table_exists?(:work_effort_assignments)
108
106
  create_table :work_effort_assignments do |t|
107
+ #foreign keys
108
+ t.references :work_effort
109
+
109
110
  t.datetime :assigned_at
110
111
  t.datetime :assigned_from
111
112
  t.datetime :assigned_thru
@@ -123,6 +124,7 @@ class BaseWorkEfforts < ActiveRecord::Migration
123
124
  add_index :work_effort_assignments, [:assigned_to_id, :assigned_to_type], :name => "assigned_to"
124
125
  add_index :work_effort_assignments, :assigned_from
125
126
  add_index :work_effort_assignments, :assigned_thru
127
+ add_index :work_effort_assignments, :work_effort_id
126
128
  end
127
129
 
128
130
  ## valid_work_assignments
@@ -0,0 +1,13 @@
1
+ class AddWorkEffortToWorkEffortAssignment < ActiveRecord::Migration
2
+ def change
3
+ unless columns(:work_effort_assignments).collect {|c| c.name}.include?('work_effort_id')
4
+ add_column :work_effort_assignments, :work_effort_id, :integer
5
+
6
+ # migrate data
7
+ execute "UPDATE work_effort_assignments SET work_effort_assignments.work_effort_id=work_efforts.work_effort_assignment_id
8
+ FROM work_effort_assignments JOIN work_efforts ON work_effort_assignments.id=work_efforts.work_effort_assignment_id"
9
+
10
+ remove_column :work_efforts, :work_effort_assignment_id
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,4 @@
1
+ require "erp_work_effort/version"
1
2
  require "erp_work_effort/extensions"
2
3
  require "erp_work_effort/engine"
3
4
 
@@ -8,6 +8,12 @@ module ErpWorkEffort
8
8
  include ErpWorkEffort::Extensions::ActiveRecord::ActsAsSupportEffort
9
9
  include ErpWorkEffort::Extensions::ActiveRecord::ActsAsSupportRequirement
10
10
  end
11
-
11
+
12
+ #TODO
13
+ #this will be removed once rails 3.2 adds the ability to set the order of engine loading
14
+ engine = self
15
+ config.to_prepare do
16
+ ErpBaseErpSvcs.register_compass_ae_engine(engine)
17
+ end
12
18
  end
13
19
  end
@@ -24,7 +24,7 @@ module ErpWorkEffort
24
24
  :description=,
25
25
  :facility,
26
26
  :facility=,
27
- :work_effort_assignment,
27
+ :work_effort_assignments,
28
28
  :work_effort_statuses,
29
29
  :projected_cost,
30
30
  :projected_cost=,
@@ -22,7 +22,7 @@ module ErpWorkEffort
22
22
  [
23
23
  :facility,
24
24
  :facility=,
25
- :work_effort_assignment,
25
+ :work_effort_assignments,
26
26
  :work_effort_statuses,
27
27
  :projected_cost,
28
28
  :actual_cost
@@ -1,3 +1,9 @@
1
1
  module ErpWorkEffort
2
- VERSION = "3.0.0"
2
+ module VERSION #:nodoc:
3
+ MAJOR = 3
4
+ MINOR = 0
5
+ TINY = 1
6
+
7
+ STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
+ end
3
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_work_effort
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,41 +9,30 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-06 00:00:00.000000000Z
12
+ date: 2012-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erp_tech_svcs
16
- requirement: &2157337500 !ruby/object:Gem::Requirement
16
+ requirement: &73905920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - =
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: 3.0.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2157337500
25
- - !ruby/object:Gem::Dependency
26
- name: erp_base_erp_svcs
27
- requirement: &2157336660 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
33
- type: :runtime
34
- prerelease: false
35
- version_requirements: *2157336660
24
+ version_requirements: *73905920
36
25
  - !ruby/object:Gem::Dependency
37
26
  name: erp_dev_svcs
38
- requirement: &2157335720 !ruby/object:Gem::Requirement
27
+ requirement: &73904210 !ruby/object:Gem::Requirement
39
28
  none: false
40
29
  requirements:
41
- - - ! '>='
30
+ - - =
42
31
  - !ruby/object:Gem::Version
43
- version: '0'
32
+ version: 3.0.1
44
33
  type: :development
45
34
  prerelease: false
46
- version_requirements: *2157335720
35
+ version_requirements: *73904210
47
36
  description: Description of ErpWorkEffort.
48
37
  email:
49
38
  - russonrails@gmail.com
@@ -51,82 +40,83 @@ executables: []
51
40
  extensions: []
52
41
  extra_rdoc_files: []
53
42
  files:
54
- - app/assets/javascripts/erp_work_effort/application.js
55
43
  - app/assets/stylesheets/erp_work_effort/application.css
56
- - app/controllers/erp_work_effort/application_controller.rb
57
- - app/helpers/erp_work_effort/application_helper.rb
58
- - app/models/cost.rb
59
- - app/models/extensions/party.rb
44
+ - app/assets/javascripts/erp_work_effort/application.js
45
+ - app/views/layouts/erp_work_effort/application.html.erb
46
+ - app/models/work_effort_status.rb
47
+ - app/models/work_requirement.rb
60
48
  - app/models/party_resource_availability.rb
61
- - app/models/party_resource_availability_type.rb
62
- - app/models/project_effort.rb
49
+ - app/models/work_requirement_work_effort_status_type.rb
50
+ - app/models/valid_work_assignment_attribute.rb
63
51
  - app/models/project_requirement.rb
64
- - app/models/support_effort.rb
65
52
  - app/models/support_requirement.rb
66
53
  - app/models/valid_work_assignment.rb
67
- - app/models/valid_work_assignment_attribute.rb
68
- - app/models/work_effort.rb
69
- - app/models/work_effort_assignment.rb
70
- - app/models/work_effort_status.rb
54
+ - app/models/project_effort.rb
71
55
  - app/models/work_effort_status_type.rb
72
- - app/models/work_requirement.rb
73
- - app/models/work_requirement_work_effort_status_type.rb
74
- - app/views/layouts/erp_work_effort/application.html.erb
56
+ - app/models/party_resource_availability_type.rb
57
+ - app/models/support_effort.rb
58
+ - app/models/work_effort_assignment.rb
59
+ - app/models/work_effort.rb
60
+ - app/models/cost.rb
61
+ - app/models/extensions/party.rb
62
+ - app/helpers/erp_work_effort/application_helper.rb
63
+ - app/controllers/erp_work_effort/application_controller.rb
75
64
  - config/routes.rb
76
65
  - db/migrate/20100220000000_base_work_efforts.rb
66
+ - db/migrate/upgrade/20111216190747_add_work_effort_to_work_effort_assignment.rb
77
67
  - lib/erp_work_effort/engine.rb
78
- - lib/erp_work_effort/extensions/active_record/acts_as_project_effort.rb
68
+ - lib/erp_work_effort/extensions.rb
79
69
  - lib/erp_work_effort/extensions/active_record/acts_as_project_requirement.rb
70
+ - lib/erp_work_effort/extensions/active_record/acts_as_project_effort.rb
80
71
  - lib/erp_work_effort/extensions/active_record/acts_as_support_effort.rb
81
72
  - lib/erp_work_effort/extensions/active_record/acts_as_support_requirement.rb
82
- - lib/erp_work_effort/extensions.rb
83
73
  - lib/erp_work_effort/version.rb
84
74
  - lib/erp_work_effort.rb
85
75
  - lib/tasks/erp_work_effort_tasks.rake
86
76
  - GPL-3-LICENSE
87
77
  - Rakefile
88
78
  - README.rdoc
89
- - spec/dummy/app/assets/javascripts/application.js
79
+ - spec/spec_helper.rb
80
+ - spec/models/valid_work_assignment_spec.rb
81
+ - spec/models/project_effort_spec.rb
82
+ - spec/models/support_requirement_spec.rb
83
+ - spec/models/project_requirement_spec.rb
84
+ - spec/models/cost_spec.rb
85
+ - spec/models/work_requirement_work_effort_status_type._spec.rb
86
+ - spec/models/valid_work_assignment_attribute_spec.rb
87
+ - spec/models/party_resource_availability_type_spec.rb
88
+ - spec/models/work_effort_status_spec.rb
89
+ - spec/models/support_effort_spec.rb
90
+ - spec/models/work_effort_assignment_spec.rb
91
+ - spec/models/work_effort_status_type_spec.rb
92
+ - spec/models/party_resource_availability_spec.rb
93
+ - spec/models/work_effort_spec.rb
94
+ - spec/models/work_requirement_spec.rb
95
+ - spec/dummy/public/422.html
96
+ - spec/dummy/public/404.html
97
+ - spec/dummy/public/500.html
98
+ - spec/dummy/public/favicon.ico
99
+ - spec/dummy/config.ru
90
100
  - spec/dummy/app/assets/stylesheets/application.css
91
- - spec/dummy/app/controllers/application_controller.rb
92
- - spec/dummy/app/helpers/application_helper.rb
101
+ - spec/dummy/app/assets/javascripts/application.js
93
102
  - spec/dummy/app/views/layouts/application.html.erb
94
- - spec/dummy/config/application.rb
103
+ - spec/dummy/app/helpers/application_helper.rb
104
+ - spec/dummy/app/controllers/application_controller.rb
105
+ - spec/dummy/config/routes.rb
106
+ - spec/dummy/config/locales/en.yml
95
107
  - spec/dummy/config/boot.rb
96
- - spec/dummy/config/database.yml
97
- - spec/dummy/config/environment.rb
108
+ - spec/dummy/config/application.rb
98
109
  - spec/dummy/config/environments/spec.rb
99
- - spec/dummy/config/initializers/backtrace_silencers.rb
100
- - spec/dummy/config/initializers/inflections.rb
101
110
  - spec/dummy/config/initializers/mime_types.rb
102
- - spec/dummy/config/initializers/secret_token.rb
103
111
  - spec/dummy/config/initializers/session_store.rb
112
+ - spec/dummy/config/initializers/backtrace_silencers.rb
104
113
  - spec/dummy/config/initializers/wrap_parameters.rb
105
- - spec/dummy/config/locales/en.yml
106
- - spec/dummy/config/routes.rb
107
- - spec/dummy/config.ru
108
- - spec/dummy/public/404.html
109
- - spec/dummy/public/422.html
110
- - spec/dummy/public/500.html
111
- - spec/dummy/public/favicon.ico
114
+ - spec/dummy/config/initializers/inflections.rb
115
+ - spec/dummy/config/initializers/secret_token.rb
116
+ - spec/dummy/config/environment.rb
117
+ - spec/dummy/config/database.yml
112
118
  - spec/dummy/Rakefile
113
119
  - spec/dummy/script/rails
114
- - spec/models/cost_spec.rb
115
- - spec/models/party_resource_availability_spec.rb
116
- - spec/models/party_resource_availability_type_spec.rb
117
- - spec/models/project_effort_spec.rb
118
- - spec/models/project_requirement_spec.rb
119
- - spec/models/support_effort_spec.rb
120
- - spec/models/support_requirement_spec.rb
121
- - spec/models/valid_work_assignment_attribute_spec.rb
122
- - spec/models/valid_work_assignment_spec.rb
123
- - spec/models/work_effort_assignment_spec.rb
124
- - spec/models/work_effort_spec.rb
125
- - spec/models/work_effort_status_spec.rb
126
- - spec/models/work_effort_status_type_spec.rb
127
- - spec/models/work_requirement_spec.rb
128
- - spec/models/work_requirement_work_effort_status_type._spec.rb
129
- - spec/spec_helper.rb
130
120
  homepage: http://development.compassagile.com
131
121
  licenses: []
132
122
  post_install_message:
@@ -152,44 +142,44 @@ signing_key:
152
142
  specification_version: 3
153
143
  summary: Summary of ErpWorkEffort.
154
144
  test_files:
155
- - spec/dummy/app/assets/javascripts/application.js
145
+ - spec/spec_helper.rb
146
+ - spec/models/valid_work_assignment_spec.rb
147
+ - spec/models/project_effort_spec.rb
148
+ - spec/models/support_requirement_spec.rb
149
+ - spec/models/project_requirement_spec.rb
150
+ - spec/models/cost_spec.rb
151
+ - spec/models/work_requirement_work_effort_status_type._spec.rb
152
+ - spec/models/valid_work_assignment_attribute_spec.rb
153
+ - spec/models/party_resource_availability_type_spec.rb
154
+ - spec/models/work_effort_status_spec.rb
155
+ - spec/models/support_effort_spec.rb
156
+ - spec/models/work_effort_assignment_spec.rb
157
+ - spec/models/work_effort_status_type_spec.rb
158
+ - spec/models/party_resource_availability_spec.rb
159
+ - spec/models/work_effort_spec.rb
160
+ - spec/models/work_requirement_spec.rb
161
+ - spec/dummy/public/422.html
162
+ - spec/dummy/public/404.html
163
+ - spec/dummy/public/500.html
164
+ - spec/dummy/public/favicon.ico
165
+ - spec/dummy/config.ru
156
166
  - spec/dummy/app/assets/stylesheets/application.css
157
- - spec/dummy/app/controllers/application_controller.rb
158
- - spec/dummy/app/helpers/application_helper.rb
167
+ - spec/dummy/app/assets/javascripts/application.js
159
168
  - spec/dummy/app/views/layouts/application.html.erb
160
- - spec/dummy/config/application.rb
169
+ - spec/dummy/app/helpers/application_helper.rb
170
+ - spec/dummy/app/controllers/application_controller.rb
171
+ - spec/dummy/config/routes.rb
172
+ - spec/dummy/config/locales/en.yml
161
173
  - spec/dummy/config/boot.rb
162
- - spec/dummy/config/database.yml
163
- - spec/dummy/config/environment.rb
174
+ - spec/dummy/config/application.rb
164
175
  - spec/dummy/config/environments/spec.rb
165
- - spec/dummy/config/initializers/backtrace_silencers.rb
166
- - spec/dummy/config/initializers/inflections.rb
167
176
  - spec/dummy/config/initializers/mime_types.rb
168
- - spec/dummy/config/initializers/secret_token.rb
169
177
  - spec/dummy/config/initializers/session_store.rb
178
+ - spec/dummy/config/initializers/backtrace_silencers.rb
170
179
  - spec/dummy/config/initializers/wrap_parameters.rb
171
- - spec/dummy/config/locales/en.yml
172
- - spec/dummy/config/routes.rb
173
- - spec/dummy/config.ru
174
- - spec/dummy/public/404.html
175
- - spec/dummy/public/422.html
176
- - spec/dummy/public/500.html
177
- - spec/dummy/public/favicon.ico
180
+ - spec/dummy/config/initializers/inflections.rb
181
+ - spec/dummy/config/initializers/secret_token.rb
182
+ - spec/dummy/config/environment.rb
183
+ - spec/dummy/config/database.yml
178
184
  - spec/dummy/Rakefile
179
185
  - spec/dummy/script/rails
180
- - spec/models/cost_spec.rb
181
- - spec/models/party_resource_availability_spec.rb
182
- - spec/models/party_resource_availability_type_spec.rb
183
- - spec/models/project_effort_spec.rb
184
- - spec/models/project_requirement_spec.rb
185
- - spec/models/support_effort_spec.rb
186
- - spec/models/support_requirement_spec.rb
187
- - spec/models/valid_work_assignment_attribute_spec.rb
188
- - spec/models/valid_work_assignment_spec.rb
189
- - spec/models/work_effort_assignment_spec.rb
190
- - spec/models/work_effort_spec.rb
191
- - spec/models/work_effort_status_spec.rb
192
- - spec/models/work_effort_status_type_spec.rb
193
- - spec/models/work_requirement_spec.rb
194
- - spec/models/work_requirement_work_effort_status_type._spec.rb
195
- - spec/spec_helper.rb