forked from shanil-puri/blogger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated setup rake to use correct roles and permissions.
- Loading branch information
Shanil Puri
committed
Sep 23, 2014
1 parent
f987037
commit f1caf4c
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
|