Implement role authorization

This commit is contained in:
Stella Rouzi 2014-08-12 11:51:59 +03:00
parent 6755328c4c
commit e2fb434dc7
122 changed files with 1386 additions and 751 deletions

View file

@ -5,18 +5,18 @@
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
Role.create(name: "Participant")
Role.create(name: "Organizer")
Role.create(name: "Admin")
qtype_yesno = QuestionType.create(title: "Yes/No")
QuestionType.create(title: "Single Choice")
QuestionType.create(title: "Multiple Choice")
# Questions
qtype_yesno = QuestionType.create(title: 'Yes/No')
qtype_single = QuestionType.create(title: 'Single Choice')
qtype_multiple = QuestionType.create(title: 'Multiple Choice')
answer_yes = Answer.create(title: "Yes")
answer_no = Answer.create(title: "No")
answer_yes = Answer.create(title: 'Yes')
answer_no = Answer.create(title: 'No')
questions_yes_no = ["Do you need handicapped access to the venue?", "Are you attending with partner?", "Will you attend the social event(s)?", "Will you stay at suggested hotel?"]
questions_yes_no = ['Do you need handicapped access to the venue?',
'Are you attending with partner?', 'Will you attend the social event(s)?',
'Will you stay at suggested hotel?']
questions_yes_no.each do |i|
q = Question.create(title: i, question_type_id: qtype_yesno.id, global: true)