Skip to content

Commit

Permalink
Updated setup rake to use correct roles and permissions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shanil Puri committed Sep 23, 2014
1 parent f987037 commit f1caf4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/tasks/setup.rake
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
desc "setup the application for use"
task :setup_sample_application => [:environment] do
puts "Application is being prepared. Please wait."
perm_list = ['application_admin', 'can_publish']
perm_list = ['application_admin', 'can_publish', 'can_apply']
perm_list.each do |p|
Permission.find_or_create_by(:name => p)
end
role_list = ["Admin", "Editor", "Reporter"]
role_list = ["Admin", "Employer", "Jobseeker"]
role_list.each do |r|
Role.find_or_create_by(:name => (r))
end

Role.find_by(:name => "Admin").permissions << Permission.all
Role.find_by(:name => "Editor").permissions << Permission.find_by(:name => "can_publish")
Role.find_by(:name => "Jobseeker").permissions << Permission.find_by(:name => "can_apply")

# Create Dummy Admin User
user = User.create!(:name => "Shanil Puri", :email => "[email protected]", :phone => 9199860912, :password => "1234567x", :password_confirmation => "1234567x")
Expand Down

0 comments on commit f1caf4c

Please sign in to comment.