Skip to content

Commit

Permalink
Fix deploy error
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikssn committed Apr 5, 2015
1 parent 9b553f1 commit 8dc3d5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/tasks/permissions.rake
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ namespace 'permissions' do
write_permission(controller.permission, 'manage', 'manage') #add permission to do CRUD for every model.
controller.action_methods.each do |method|
if method =~ /^([A-Za-z\d*]+)+([\w]*)+([A-Za-z\d*]+)$/ #add_user, add_user_info, Add_user, add_User
name, cancan_action = eval_cancan_action(method)
write_permission(controller.permission, cancan_action, name)
_, cancan_action = eval_cancan_action(method)
write_permission(controller.permission, cancan_action)
end
end
end
Expand Down Expand Up @@ -65,6 +65,6 @@ def eval_cancan_action(action)
end

#check if the permission is present else add a new one.
def write_permission(model, cancan_action, name)
Permission.find_or_create_by(name: name, subject_class: model, action: cancan_action)
def write_permission(model, cancan_action)
Permission.find_or_create_by(subject_class: model, action: cancan_action)
end

0 comments on commit 8dc3d5a

Please sign in to comment.