effective_work_experience 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +49 -4
- data/app/models/concerns/effective_work_experience_user.rb +1 -1
- data/lib/effective_work_experience/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b1b17b8acb26be41f882c4aba1bd5546986dc12bed911b4ee7fba690d1dee4b
|
|
4
|
+
data.tar.gz: a40e92b082bc6217ee0c3fc11452b7c3aa36afa35b95571b3a140eccbedd1bbf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4741e55d2afddd0d6e7478ee8adcd5fdcf8f3307e669fb4a84ff522efbd5657b583f22ccc295953dc41076c82b44619738b647df6a38e10b5b9bec6029fdd691
|
|
7
|
+
data.tar.gz: b283fcdc327b1353f89bc43ae92012271dd21a9307cf6a7c11801fccfc54a71df5bce0eee3a00c04c0747a55f61d6e5f6acbc6c575d5dac746696c02475c41f5
|
data/README.md
CHANGED
|
@@ -65,33 +65,78 @@ and configure it:
|
|
|
65
65
|
config.work_experience_summary_class_name = 'Bcsla::WorkExperienceSummary'
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
+
## Categories
|
|
69
|
+
|
|
70
|
+
Nothing works until there are categories and subcategories to record hours against — a new record
|
|
71
|
+
has one row per subcategory, so with none it is an empty form. Every application defines its own,
|
|
72
|
+
either from the admin screens or from its own seeds. See `db/seeds.rb` for an example set.
|
|
73
|
+
|
|
74
|
+
`minimum_hours` is optional on both. The work experience report shows a target and a percent
|
|
75
|
+
complete for each category and subcategory that has one, and just the hours to date for those that
|
|
76
|
+
don't.
|
|
77
|
+
|
|
68
78
|
## User
|
|
69
79
|
|
|
70
|
-
|
|
80
|
+
An intern's mentor is another user, so this gem needs one column on your users table. The install
|
|
81
|
+
migration does not add it. Write your own:
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
class AddWorkExperienceMentorToUsers < ActiveRecord::Migration[8.0]
|
|
85
|
+
def change
|
|
86
|
+
add_column :users, :work_experience_mentor_id, :integer
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Then add the following to your User model:
|
|
71
92
|
|
|
72
93
|
```ruby
|
|
73
94
|
effective_work_experience_user
|
|
74
95
|
```
|
|
75
96
|
|
|
76
|
-
|
|
97
|
+
which adds the `belongs_to :work_experience_mentor` for that column, plus:
|
|
77
98
|
|
|
78
|
-
- `work_experience_mentor` — the user who reviews my work experience summaries
|
|
79
99
|
- `work_experience_mentees` — the interns I am a mentor for
|
|
80
100
|
- `work_experience_outside_mentor` — my mentor when they don't have an account. A `has_one`.
|
|
81
101
|
- `work_experience_records`, `work_experience_entries`, `work_experience_projects`, `work_experience_summaries`, `mentee_work_experience_summaries`
|
|
82
102
|
- the `work_experience_hours`, `work_experience_hours_by_year` and `work_experience_total_hours_to_date` calculations
|
|
103
|
+
- `work_experience_intern?`, `work_experience_mentor?` and `work_experience_outside_mentor?`, used by the views and permissions below
|
|
83
104
|
|
|
84
105
|
An intern with an outside mentor has no `work_experience_mentor`, so their summaries are reviewed automatically on submit.
|
|
85
106
|
|
|
86
107
|
The summary's `user`, `mentor` and `supervisor` are polymorphic. A summary assigns its mentor from the user's `work_experience_mentor`, and its supervisor from the user's `supervisor` when your User model defines one.
|
|
87
108
|
|
|
109
|
+
### Who is an intern
|
|
110
|
+
|
|
111
|
+
`work_experience_intern?` is true once a user has any records or summaries. To have someone see the
|
|
112
|
+
intern dashboard before they've recorded anything, define `intern?` on your User model and it will
|
|
113
|
+
be used too:
|
|
114
|
+
|
|
115
|
+
```ruby
|
|
116
|
+
def intern?
|
|
117
|
+
membership.present? && membership.category.intern?
|
|
118
|
+
end
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Admin user form
|
|
122
|
+
|
|
88
123
|
Render the mentor fields from your own admin user form:
|
|
89
124
|
|
|
90
125
|
```haml
|
|
91
|
-
= render('
|
|
126
|
+
= render('admin/work_experience/user_fields', f: f, hint: 'Who can be a mentor')
|
|
92
127
|
```
|
|
93
128
|
|
|
94
129
|
This is the `work_experience_mentor` select plus an `f.has_many` builder for the one outside mentor.
|
|
130
|
+
The `work_experience_mentor_id` and `work_experience_outside_mentors_attributes` params are permitted
|
|
131
|
+
by effective_resources for free — there is nothing to add to your `effective_resource do` block.
|
|
132
|
+
|
|
133
|
+
Render an intern's records, projects, summaries and report as a tab on the same form:
|
|
134
|
+
|
|
135
|
+
```haml
|
|
136
|
+
- if user.work_experience_intern?
|
|
137
|
+
= tab Effective::WorkExperienceRecord, label: 'Work Experience' do
|
|
138
|
+
= render('admin/work_experience/user_work_experience', user: user)
|
|
139
|
+
```
|
|
95
140
|
|
|
96
141
|
## Dashboard
|
|
97
142
|
|