Skip to content

Commit 6fda913

Browse files
committed
- added some comments
- program now has administrators and a project associated with it. - skipped authorization checks to add project to programme.
1 parent 9b52eb4 commit 6fda913

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

db/seeds/example_data/example_data.seeds.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
institution = Institution.where(title: 'Default Institution').first_or_create(country: 'United Kingdom')
55
workgroup = WorkGroup.where(project_id: project.id, institution_id: institution.id).first_or_create
66

7+
## Create an admin and a guest user
8+
9+
# Admin
710
admin_user = User.where(login: 'admin').first_or_create(
811
login: 'admin',
912
1013
password: 'adminadmin', password_confirmation: 'adminadmin'
1114
)
1215

13-
# Admin and guest
1416
admin_user.activate
1517
admin_user.build_person(first_name: 'Admin', last_name: 'User', email: '[email protected]') unless admin_user.person
1618
admin_user.save!
@@ -19,6 +21,7 @@
1921
admin_person.save
2022
puts 'Seeded 1 admin.'
2123

24+
## Guest
2225
guest_user = User.where(login: 'guest').first_or_create(
2326
login: 'guest',
2427
@@ -238,6 +241,16 @@
238241
data: item.title)
239242
end
240243

244+
# Updating programme
245+
disable_authorization_checks do
246+
program.programme_administrators = [guest_person, admin_person]
247+
program.projects = [project]
248+
# program.funding_codes_as_text = ['123456789'] # TODO cannot set funding codes
249+
# Discussion links...
250+
program.save!
251+
end
252+
253+
241254
Seek::Config.home_description = '<p style="text-align:center;font-size:larger;font-weight:bolder">Welcome to the SEEK Sandbox</p>
242255
<p style="text-align:center;font-size:larger;font-weight:bolder">You can log in with the username: <em>guest</em> and password: <em>guest</em></p>
243256
<p style="text-align:center">For more information about SEEK and to see a video, please visit our <a href="http://www.seek4science.org">Website</a>.</p>'

0 commit comments

Comments
 (0)