multiinsert 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. data/.gitignore +17 -15
  2. data/Gemfile +3 -48
  3. data/LICENSE.txt +22 -0
  4. data/README.md +28 -3
  5. data/Rakefile +1 -7
  6. data/lib/multiinsert.rb +38 -0
  7. data/lib/multiinsert/version.rb +3 -0
  8. data/multiinsert.gemspec +23 -0
  9. metadata +8 -180
  10. data/Gemfile.lock +0 -182
  11. data/README.rdoc +0 -261
  12. data/app/assets/images/Dashboard.jpg +0 -0
  13. data/app/assets/images/black.png +0 -0
  14. data/app/assets/images/giff.gif +0 -0
  15. data/app/assets/images/rails.png +0 -0
  16. data/app/assets/images/sprites.png +0 -0
  17. data/app/assets/javascripts/application.js +0 -15
  18. data/app/assets/javascripts/effects.js +0 -9
  19. data/app/assets/javascripts/evaluations.js.coffee +0 -3
  20. data/app/assets/javascripts/tabs_old.js +0 -42
  21. data/app/assets/stylesheets/application.css +0 -13
  22. data/app/assets/stylesheets/evaluations.css.scss +0 -3
  23. data/app/assets/stylesheets/style.css +0 -477
  24. data/app/assets/stylesheets/tab.css +0 -190
  25. data/app/controllers/application_controller.rb +0 -15
  26. data/app/controllers/employee_heirarchies_controller.rb +0 -2
  27. data/app/controllers/evaluations_controller.rb +0 -80
  28. data/app/controllers/sessions_controller.rb +0 -48
  29. data/app/helpers/application_helper.rb +0 -2
  30. data/app/helpers/employee_heirarchies_helper.rb +0 -2
  31. data/app/helpers/evaluations_helper.rb +0 -2
  32. data/app/mailers/.gitkeep +0 -0
  33. data/app/models/.gitkeep +0 -0
  34. data/app/models/employee.rb +0 -5
  35. data/app/models/employee_heirarchy.rb +0 -6
  36. data/app/models/evaluation.rb +0 -6
  37. data/app/models/evaluation_interval.rb +0 -5
  38. data/app/models/evaluation_period.rb +0 -6
  39. data/app/models/interval_format.rb +0 -4
  40. data/app/models/role.rb +0 -7
  41. data/app/models/score.rb +0 -3
  42. data/app/models/team.rb +0 -10
  43. data/app/models/team.rb~ +0 -10
  44. data/app/models/team_value.rb +0 -5
  45. data/app/models/user.rb +0 -49
  46. data/app/models/user.rb~ +0 -11
  47. data/app/models/user_history.rb +0 -6
  48. data/app/models/user_role.rb +0 -5
  49. data/app/models/value.rb +0 -8
  50. data/app/models/value.rb~ +0 -7
  51. data/app/views/devise/confirmations/new.html.erb +0 -12
  52. data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
  53. data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
  54. data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
  55. data/app/views/devise/passwords/edit.html.erb +0 -16
  56. data/app/views/devise/passwords/new.html.erb +0 -12
  57. data/app/views/devise/registrations/edit.html.erb +0 -29
  58. data/app/views/devise/registrations/new.html.erb +0 -36
  59. data/app/views/devise/sessions/new.html.erb +0 -17
  60. data/app/views/devise/shared/_links.erb +0 -25
  61. data/app/views/devise/unlocks/new.html.erb +0 -12
  62. data/app/views/evaluations/edit.html.erb +0 -21
  63. data/app/views/evaluations/first.html.erb +0 -5
  64. data/app/views/evaluations/index.html.erb +0 -7
  65. data/app/views/evaluations/new.html.erb +0 -15
  66. data/app/views/evaluations/show.html.erb +0 -21
  67. data/app/views/layouts/application.html.erb +0 -87
  68. data/config.ru +0 -4
  69. data/config/application.rb +0 -63
  70. data/config/boot.rb +0 -6
  71. data/config/database.yml +0 -31
  72. data/config/database.yml~ +0 -31
  73. data/config/environment.rb +0 -5
  74. data/config/environments/development.rb +0 -37
  75. data/config/environments/production.rb +0 -67
  76. data/config/environments/test.rb +0 -37
  77. data/config/initializers/backtrace_silencers.rb +0 -7
  78. data/config/initializers/devise.rb +0 -240
  79. data/config/initializers/inflections.rb +0 -15
  80. data/config/initializers/mime_types.rb +0 -5
  81. data/config/initializers/rails_admin.rb +0 -116
  82. data/config/initializers/secret_token.rb +0 -7
  83. data/config/initializers/session_store.rb +0 -8
  84. data/config/initializers/wrap_parameters.rb +0 -14
  85. data/config/locales/devise.en.yml +0 -59
  86. data/config/locales/en.yml +0 -5
  87. data/config/routes.rb +0 -70
  88. data/db/migrate/20130220053413_devise_create_users.rb +0 -52
  89. data/db/migrate/20130220055237_create_rails_admin_histories_table.rb +0 -18
  90. data/db/migrate/20130220060116_create_values.rb +0 -9
  91. data/db/migrate/20130220060116_create_values.rb~ +0 -8
  92. data/db/migrate/20130220060206_create_scores.rb +0 -9
  93. data/db/migrate/20130220060258_create_teams.rb +0 -8
  94. data/db/migrate/20130220060347_create_team_values.rb +0 -9
  95. data/db/migrate/20130220060347_create_team_values.rb~ +0 -10
  96. data/db/migrate/20130220060427_create_roles.rb +0 -8
  97. data/db/migrate/20130220060605_create_evaluation_periods.rb +0 -10
  98. data/db/migrate/20130220060807_create_evaluation_intervals.rb +0 -9
  99. data/db/migrate/20130220060902_create_interval_formats.rb +0 -9
  100. data/db/migrate/20130220061022_create_user_histories.rb +0 -13
  101. data/db/migrate/20130220061242_create_evaluations.rb +0 -16
  102. data/db/migrate/20130305063738_create_user_roles.rb +0 -9
  103. data/db/migrate/20130305091849_create_employees.rb +0 -12
  104. data/db/migrate/20130305144125_create_employee_heirarchies.rb +0 -13
  105. data/db/migrate/20130305150244_add_foreign_keys_to_employee_heirarchies.rb +0 -6
  106. data/db/migrate/20130307035139_addmanagerid_to_evaluations.rb +0 -9
  107. data/db/schema.rb +0 -175
  108. data/db/seeds.rb +0 -7
  109. data/doc/README_FOR_APP +0 -2
  110. data/lib/assets/.gitkeep +0 -0
  111. data/lib/tasks/.gitkeep +0 -0
  112. data/log/.gitkeep +0 -0
  113. data/public/404.html +0 -26
  114. data/public/422.html +0 -26
  115. data/public/500.html +0 -25
  116. data/public/favicon.ico +0 -0
  117. data/public/robots.txt +0 -5
  118. data/script/rails +0 -6
  119. data/test/fixtures/.gitkeep +0 -0
  120. data/test/fixtures/evaluation_intervals.yml +0 -9
  121. data/test/fixtures/evaluation_periods.yml +0 -11
  122. data/test/fixtures/evaluations.yml +0 -19
  123. data/test/fixtures/interval_formats.yml +0 -7
  124. data/test/fixtures/roles.yml +0 -7
  125. data/test/fixtures/scores.yml +0 -9
  126. data/test/fixtures/team_values.yml +0 -9
  127. data/test/fixtures/teams.yml +0 -9
  128. data/test/fixtures/user_histories.yml +0 -15
  129. data/test/fixtures/users.yml +0 -11
  130. data/test/fixtures/values.yml +0 -7
  131. data/test/functional/.gitkeep +0 -0
  132. data/test/functional/employee_heirarchies_controller_test.rb +0 -7
  133. data/test/functional/evaluations_controller_test.rb +0 -7
  134. data/test/integration/.gitkeep +0 -0
  135. data/test/performance/browsing_test.rb +0 -12
  136. data/test/test_helper.rb +0 -13
  137. data/test/unit/.gitkeep +0 -0
  138. data/test/unit/evaluation_interval_test.rb +0 -7
  139. data/test/unit/evaluation_period_test.rb +0 -7
  140. data/test/unit/evaluation_test.rb +0 -7
  141. data/test/unit/helpers/employee_heirarchies_helper_test.rb +0 -4
  142. data/test/unit/helpers/evaluations_helper_test.rb +0 -4
  143. data/test/unit/interval_format_test.rb +0 -7
  144. data/test/unit/role_test.rb +0 -7
  145. data/test/unit/score_test.rb +0 -7
  146. data/test/unit/team_test.rb +0 -7
  147. data/test/unit/team_value_test.rb +0 -7
  148. data/test/unit/user_history_test.rb +0 -7
  149. data/test/unit/user_test.rb +0 -7
  150. data/test/unit/value_test.rb +0 -7
  151. data/vendor/assets/javascripts/.gitkeep +0 -0
  152. data/vendor/assets/stylesheets/.gitkeep +0 -0
  153. data/vendor/plugins/.gitkeep +0 -0
@@ -1,190 +0,0 @@
1
-
2
- #wrapper{
3
- width:80%;
4
- margin: 29px 0 0 8px;
5
- font:Arial, Helvetica, sans-serif;
6
- font-size:14px;
7
- }
8
- #wrapper h1{
9
- color:#FFF;
10
- text-align:center;
11
- margin-bottom:20px;
12
- font:Arial, Helvetica, sans-serif;
13
- font-size:14px;
14
- }
15
- .tab_head{
16
- background: #f8f8f8; /* Old browsers */
17
- background: -moz-linear-gradient(top, #f8f8f8 8%, #ededed 75%); /* FF3.6+ */
18
- background: -webkit-gradient(linear, left top, left bottom, color-stop(8%,#f8f8f8), color-stop(75%,#ededed)); /* Chrome,Safari4+ */
19
- background: -webkit-linear-gradient(top, #f8f8f8 8%,#ededed 75%); /* Chrome10+,Safari5.1+ */
20
- background: -o-linear-gradient(top, #f8f8f8 8%,#ededed 75%); /* Opera 11.10+ */
21
- background: -ms-linear-gradient(top, #f8f8f8 8%,#ededed 75%); /* IE10+ */
22
- background: linear-gradient(to bottom, #f8f8f8 8%,#ededed 75%); /* W3C */
23
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f8f8f8', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
24
- height:15px;
25
- padding:10px;
26
- border:solid 1px #dfdfdf;
27
- text-shadow: 2px 2px 2px #FFFFFF;
28
- filter: dropshadow(color=#FFFFFF, offx=3, offy=1);
29
- color:#666666;
30
- font-weight:bold;
31
- }
32
- .tab_head_arrow {
33
- background-image: url(../assets/sprites.png);
34
- width: 13px;
35
- height: 16px;
36
- float: right;
37
- background-position: -534px -61px;
38
- margin-top: 3px;
39
- }
40
- .tab_head_arrow:hover {
41
- background-image: url(../assets/sprites.png);
42
- background-position: -548px -61px;
43
- cursor:pointer;
44
- }
45
-
46
- #wrapper a{
47
- display:block;
48
- font-size:1.2em;
49
- padding-top:20px;
50
- color:#FFF;
51
- text-decoration:none;
52
- text-align:center;
53
- }
54
-
55
- #tabContainer {
56
- padding:15px;
57
- padding-bottom: 20px;
58
- background-color:#fcfcfc;
59
- -moz-border-radius: 4px;
60
- border-radius: 4px;
61
- border:solid 1px #dfdfdf;
62
- border-top:none;
63
- }
64
-
65
- #tabs{
66
- height:30px;
67
- overflow:hidden;
68
- margin-top:10px;
69
- }
70
-
71
- #tabs > ul{
72
- font: 1em;
73
- list-style:none;
74
-
75
- }
76
-
77
- #tabs > ul > li{
78
- margin:0 2px 0 0;
79
- padding:7px 10px;
80
- display:block;
81
- float:left;
82
- color:#FFF;
83
- -webkit-user-select: none;
84
- -moz-user-select: none;
85
- user-select: none;
86
- -moz-border-radius-topleft: 4px;
87
- -moz-border-radius-topright: 4px;
88
- -moz-border-radius-bottomright: 0px;
89
- -moz-border-radius-bottomleft: 0px;
90
- border-top-left-radius:4px;
91
- border-top-right-radius: 4px;
92
- border-bottom-right-radius: 0px;
93
- border-bottom-left-radius: 0px;
94
- background: #f763a1; /* Old browsers */
95
- background: -moz-linear-gradient(top, #f763a1 0%, #e32981 87%); /* FF3.6+ */
96
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f763a1), color-stop(87%,#e32981)); /* Chrome,Safari4+ */
97
- background: -webkit-linear-gradient(top, #f763a1 0%,#e32981 87%); /* Chrome10+,Safari5.1+ */
98
- background: -o-linear-gradient(top, #f763a1 0%,#e32981 87%); /* Opera 11.10+ */
99
- background: -ms-linear-gradient(top, #f763a1 0%,#e32981 87%); /* IE10+ */
100
- background: linear-gradient(to bottom, #f763a1 0%,#e32981 87%); /* W3C */
101
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f763a1', endColorstr='#e32981',GradientType=0 ); /* IE6-9 */
102
- font-size:12px;
103
- }
104
-
105
- #tabs > ul > li:hover{
106
- background: #FFFFFF; /* old browsers */
107
- background: -moz-linear-gradient(top, #FFFFFF 0%, #F3F3F3 10%, #F3F3F3 50%, #FFFFFF 100%); /* firefox */
108
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(10%,#F3F3F3), color-stop(50%,#F3F3F3), color-stop(100%,#FFFFFF)); /* webkit */
109
- cursor:pointer;
110
- color: #333;
111
- font-size:12px;
112
- }
113
-
114
- #tabs > ul > li.tabActiveHeader{
115
- background: #FFFFFF; /* old browsers */
116
- background: -moz-linear-gradient(top, #f8f8f8 8%, #ededed 75%); /* FF3.6+ */
117
- background: -webkit-gradient(linear, left top, left bottom, color-stop(8%,#f8f8f8), color-stop(75%,#ededed)); /* Chrome,Safari4+ */
118
- background: -webkit-linear-gradient(top, #f8f8f8 8%,#ededed 75%); /* Chrome10+,Safari5.1+ */
119
- background: -o-linear-gradient(top, #f8f8f8 8%,#ededed 75%); /* Opera 11.10+ */
120
- background: -ms-linear-gradient(top, #f8f8f8 8%,#ededed 75%); /* IE10+ */
121
- background: linear-gradient(to bottom, #f8f8f8 8%,#ededed 75%); /* W3C */
122
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f8f8f8', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
123
- cursor:pointer;
124
- color: #333;
125
- border:solid 1px #dfdfdf;
126
- font-size:12px;
127
- }
128
-
129
- #tabscontent {
130
- -moz-border-radius-topleft: 0px;
131
- -moz-border-radius-topright: 4px;
132
- -moz-border-radius-bottomright: 4px;
133
- -moz-border-radius-bottomleft: 4px;
134
- border-top-left-radius: 0px;
135
- border-top-right-radius: 4px;
136
- border-bottom-right-radius: 4px;
137
- border-bottom-left-radius: 4px;
138
- padding:10px 10px 25px;
139
- margin:0;
140
- color:#333;
141
- border:solid 1px #dfdfdf;
142
- background-color:#f8f8f8;
143
- border-top:none;
144
- height:auto;
145
- }
146
- table.tab_table{
147
- font-family:Arial, Helvetica, sans-serif;
148
- font-size:12px;
149
- border:solid 1px #dfdfdf;
150
- border-collapse:collapse;
151
- }
152
- table.tab_table tr{
153
- border:solid 1px #dfdfdf;
154
- }
155
- table.tab_table tr:hover {
156
- background-color: #EFEFEF;
157
- }
158
- table.tab_table td {
159
- border:solid 1px #dfdfdf;
160
- text-align:center;
161
- }
162
- table.tab_table th {background: #f8f8f8; /* Old browsers */
163
- background: -moz-linear-gradient(top, #f8f8f8 8%, #ededed 75%); /* FF3.6+ */
164
- background: -webkit-gradient(linear, left top, left bottom, color-stop(8%,#f8f8f8), color-stop(75%,#ededed)); /* Chrome,Safari4+ */
165
- background: -webkit-linear-gradient(top, #f8f8f8 8%,#ededed 75%); /* Chrome10+,Safari5.1+ */
166
- background: -o-linear-gradient(top, #f8f8f8 8%,#ededed 75%); /* Opera 11.10+ */
167
- background: -ms-linear-gradient(top, #f8f8f8 8%,#ededed 75%); /* IE10+ */
168
- background: linear-gradient(to bottom, #f8f8f8 8%,#ededed 75%); /* W3C */
169
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f8f8f8', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
170
- border:solid 1px #dfdfdf;
171
- }
172
- .point_text_box {
173
- width:40px;
174
- }
175
- .numb {
176
- background-color:#FFFFFF;
177
- padding:2px;
178
- border:solid 1px #dfdfdf;
179
- padding-left:5px;
180
- padding-right:5px;
181
- }
182
- .value_bold {
183
- padding:10px;
184
- }
185
- .over_due {
186
- background-color:#FF0000;
187
- width:100px;
188
- color:#FFFFFF;
189
- padding:2px;
190
- }
@@ -1,15 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
-
4
- def set_current_user
5
- User.current = current_user
6
- end
7
-
8
- def after_sign_in_path_for(resource)
9
- new_evaluation_path
10
- end
11
-
12
- def after_sign_out_path_for(resource)
13
- root_path
14
- end
15
- end
@@ -1,2 +0,0 @@
1
- class EmployeeHeirarchiesController < ApplicationController
2
- end
@@ -1,80 +0,0 @@
1
- class EvaluationsController < ApplicationController
2
- #~ before_filter :values, :only => [:show, :edit, :update, :destroy]
3
- def index
4
- @evaluations=Evaluation.all
5
- end
6
-
7
- def new
8
- @team=TeamValue.where("team_id= ?",1)
9
- @team.each do |a|
10
- @tea = a.value.description
11
- end
12
- @values = Value.all
13
- @managers = EmployeeHeirarchy.employees(current_user.id).collect{|employee| User.find(employee.manager_id)}
14
- @evaluation = Evaluation.new
15
- end
16
-
17
- def save_evaluations(params)
18
-
19
- evaluation_records = params.select{|param| param.match(/^evaluation/)}
20
-
21
- value_ids = evaluation_records.keys.collect{|rec| rec.split("-")[2]}.uniq!
22
- @eval = Evaluation.new
23
- @saved = false
24
-
25
- value_ids.each do |item|
26
-
27
- evaluation_records.each do |evaluation|
28
- if evaluation.first.split("-")[2] == item
29
- @eval[evaluation.first.split("-")[1]] = evaluation.last.split.join
30
- else
31
- break if !@saved
32
- end
33
- end
34
- saved = @eval.save
35
- @eval = Evaluation.new
36
- @saved = true
37
- saved
38
- end
39
-
40
- end
41
-
42
- def create
43
-
44
- if save_evaluations(params)
45
- redirect_to :action => :edit
46
- else
47
- render :action => :new
48
- end
49
- end
50
-
51
- def show
52
- @evaluations = Evaluation.where(:id => params[:id])
53
- end
54
-
55
- def edit
56
- @evaluations = Evaluation.where(:user_id => current_user.id)
57
- end
58
-
59
- def update
60
- @evaluation = Evaluation.find(params[:id])
61
- if @evaluation.update_attributes(params[:evaluation])
62
- render :action => :show
63
- else
64
- render :action => :edit
65
- end
66
- end
67
-
68
- def destroy
69
- @evaluation = Evaluation.find(params[:id])
70
- @evaluation.destroy
71
- end
72
-
73
- def first
74
- end
75
-
76
- #~ def values
77
- #~ @value=Evaluation.find(params[:id]).value.description
78
- #~ end
79
-
80
- end
@@ -1,48 +0,0 @@
1
- class SessionsController < Devise::SessionsController
2
- prepend_before_filter :require_no_authentication, :only => [ :new, :create ]
3
- prepend_before_filter :allow_params_authentication!, :only => :create
4
- prepend_before_filter { request.env["devise.skip_timeout"] = true }
5
-
6
- # GET /resource/sign_in
7
- def new
8
- self.resource = build_resource(nil, :unsafe => true)
9
- clean_up_passwords(resource)
10
- respond_with(resource, serialize_options(resource))
11
- end
12
-
13
- # POST /resource/sign_in
14
- def create
15
- self.resource = warden.authenticate!(auth_options)
16
- set_flash_message(:notice, :signed_in) if is_navigational_format?
17
- sign_in(resource_name, resource)
18
- respond_with resource, :location => after_sign_in_path_for(resource)
19
- end
20
-
21
- # DELETE /resource/sign_out
22
- def destroy
23
- redirect_path = after_sign_out_path_for(resource_name)
24
- signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
25
- set_flash_message :notice, :signed_out if signed_out && is_navigational_format?
26
-
27
- # We actually need to hardcode this as Rails default responder doesn't
28
- # support returning empty response on GET request
29
- respond_to do |format|
30
- format.all { head :no_content }
31
- format.any(*navigational_formats) { redirect_to redirect_path }
32
- end
33
- end
34
-
35
- protected
36
-
37
- def serialize_options(resource)
38
- methods = resource_class.authentication_keys.dup
39
- methods = methods.keys if methods.is_a?(Hash)
40
- methods << :password if resource.respond_to?(:password)
41
- { :methods => methods, :only => [:password] }
42
- end
43
-
44
- def auth_options
45
- { :scope => resource_name, :recall => "#{controller_path}#new" }
46
- end
47
- end
48
-
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- module EmployeeHeirarchiesHelper
2
- end
@@ -1,2 +0,0 @@
1
- module EvaluationsHelper
2
- end
File without changes
File without changes
@@ -1,5 +0,0 @@
1
- class Employee < ActiveRecord::Base
2
- belongs_to :user
3
- belongs_to :manager, :class_name => "User", :foreign_key => "manager_id"
4
- # attr_accessible :title, :body
5
- end
@@ -1,6 +0,0 @@
1
- class EmployeeHeirarchy < ActiveRecord::Base
2
-
3
- scope :employees, lambda {|employee_id| {:conditions => ['employee_id = ?',employee_id] }}
4
- scope :managers, lambda {|manager_id| {:conditions => ['manager_id = ?',manager_id] }}
5
-
6
- end
@@ -1,6 +0,0 @@
1
- class Evaluation < ActiveRecord::Base
2
- attr_accessible :evaluation_period_id, :manager_comments, :manager_points, :self_comments, :self_points, :user_id, :value_id,:final_comments, :final_points
3
- belongs_to :user
4
- belongs_to :value, :autosave => true
5
- belongs_to :evaluation_periods
6
- end
@@ -1,5 +0,0 @@
1
- class EvaluationInterval < ActiveRecord::Base
2
- attr_accessible :interval_format_id, :team_id
3
- belongs_to :interval_format
4
- belongs_to :team
5
- end
@@ -1,6 +0,0 @@
1
- class EvaluationPeriod < ActiveRecord::Base
2
- attr_accessible :eval_end_date, :eval_start_date, :team_id
3
- belongs_to :team
4
- has_many :evaluations
5
- has_many :user_histories
6
- end
@@ -1,4 +0,0 @@
1
- class IntervalFormat < ActiveRecord::Base
2
- attr_accessible :frequency
3
- has_many :evaluation_intervals
4
- end
@@ -1,7 +0,0 @@
1
- class Role < ActiveRecord::Base
2
- attr_accessible :role_description
3
- #~ has_many :users
4
- has_many :user_roles
5
- has_many :users, :through => :user_roles
6
-
7
- end
@@ -1,3 +0,0 @@
1
- class Score < ActiveRecord::Base
2
- attr_accessible :description, :level
3
- end
@@ -1,10 +0,0 @@
1
- class Team < ActiveRecord::Base
2
- attr_accessible :designation, :name
3
- has_many :team_values
4
- has_many :values, :through => :team_values
5
- has_many :users
6
- has_many :evaluation_periods
7
- has_many :evaluation_intervals
8
- has_many :user_histories
9
- #~ has_many :values
10
- end
@@ -1,10 +0,0 @@
1
- class Team < ActiveRecord::Base
2
- attr_accessible :designation, :name
3
- has_many :team_values
4
- has_many :values, :through => :team_values
5
- has_many :users
6
- has_many :evaluation_periods
7
- has_many :evaluation_intervals
8
- has_many :user_histories
9
- #~ has_many :values
10
- end
@@ -1,5 +0,0 @@
1
- class TeamValue < ActiveRecord::Base
2
- attr_accessible :team_id, :value_id
3
- belongs_to :value
4
- belongs_to :team
5
- end
@@ -1,49 +0,0 @@
1
- class User < ActiveRecord::Base
2
- # Include default devise modules. Others available are:
3
- # :token_authenticatable, :confirmable,
4
- # :lockable, :timeoutable and :omniauthable
5
- devise :database_authenticatable, :registerable,:confirmable,
6
- :recoverable, :rememberable, :trackable, :validatable
7
- # Setup accessible (or protected) attributes for your model
8
- attr_accessible :email, :password, :password_confirmation, :remember_me, :firstname, :lastname, :phonenum, :address, :team_id, :role_id, :evaulation,:manager_id
9
- belongs_to :team
10
- # belongs_to :role
11
- has_many :evaluations
12
- has_many :user_histories
13
- #~ attr_accessible :title, :body
14
- has_many :user_roles
15
- has_many :roles, :through => :user_roles
16
- accepts_nested_attributes_for :evaluations
17
-
18
- #~ has_many :subordinates, :class_name => "User", :foreign_key => "manager_id"
19
- #~ belongs_to :manager, :class_name => "User"
20
-
21
- scope :managers, :conditions => { :role_id => 2 }
22
-
23
- rails_admin do
24
- list do
25
- field :email
26
- field :password
27
- field :password_confirmation
28
- field :team_id
29
- field :role_id
30
- field :manager_id
31
- end
32
- show do
33
- field :email
34
- field :password
35
- field :password_confirmation
36
- field :team_id
37
- field :role_id
38
- field :manager_id
39
- end
40
- edit do
41
- field :email
42
- field :password
43
- field :password_confirmation
44
- field :team_id
45
- field :role_id
46
- field :manager_id
47
- end
48
- end
49
- end