Skip to content

Commit 57ead56

Browse files
committed
feat: add migration to create CaseLog and instructor invitiations
1 parent 4acddcc commit 57ead56

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# frozen_string_literal: true
2+
3+
class AddCaseLog < ActiveRecord::Migration[5.1]
4+
def change
5+
reversible do |dir|
6+
dir.up do
7+
Role.create name: :instructor
8+
9+
Community.create(
10+
name: 'CaseLog',
11+
universal: true,
12+
description: <<~DESCRIPTION
13+
CaseLog is a community of practice for instructors teaching with
14+
cases on Gala. Case studies, like all forms of engaged learning,
15+
work best when they’re tuned for your specific audience. As you and
16+
your teaching team prepare to use a case with your students, read
17+
other instructors’ write-ups about what worked and what didn’t in
18+
their classroom. These “meta case studies” will provide some
19+
inspiration.\n
20+
After you’ve deployed this case, add your voice to the conversation.
21+
Share the choices you made and why you made them. Did you structure
22+
your classroom discussion in a particular way? Did you employ an
23+
interesting simulation or exercise? Tell us about it.
24+
DESCRIPTION
25+
)
26+
27+
Reader.joins(:enrollments)
28+
.where(enrollments: { status: :instructor })
29+
.distinct
30+
.find_each { |reader| reader.add_role :instructor }
31+
end
32+
dir.down do
33+
Community.where(name: 'CaseLog', universal: true).each(&:destroy)
34+
35+
Role.where(name: :instructor).destroy
36+
end
37+
end
38+
end
39+
end

db/seeds.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
Community.create name: 'CaseLog', universal: true, description: <<~DESCRIPTION
88
CaseLog is a community of practice for instructors teaching with cases on
99
Gala. Case studies, like all forms of engaged learning, work best when they’re
10-
tuned for your specific audience. As you prepare to use a case with your
11-
students, read other instructors’ write-ups about what worked and what didn’t
12-
in their classroom. Hopefully these “meta case studies” will provide some
13-
inspiration.
10+
tuned for your specific audience. As you and your teaching team prepare to use
11+
a case with your students, read other instructors’ write-ups about what worked
12+
and what didn’t in their classroom. These “meta case studies” will provide
13+
some inspiration.
1414
15-
And after you’ve deployed this case, add your voice to the conversation. Share
15+
After you’ve deployed this case, add your voice to the conversation. Share
1616
the choices you made and why you made them. Did you structure your classroom
1717
discussion in a particular way? Did you employ an interesting simulation or
1818
exercise? Tell us about it.

db/structure.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2308,6 +2308,7 @@ INSERT INTO "schema_migrations" (version) VALUES
23082308
('20171031161433'),
23092309
('20171113192541'),
23102310
('20171220165301'),
2311-
('20180119170858');
2311+
('20180119170858'),
2312+
('20180129143420');
23122313

23132314

0 commit comments

Comments
 (0)