Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix issues with Model Inheritance:

  Set the sanction_roles.principal_type to the Child's class, rather than Child's base_class
  • Loading branch information...
commit 3212858ace0c663042410d0b79841ef964cb180c 1 parent 4c41656
Peter Leonhardt pjleonhardt authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/sanction/principal/grant.rb
2  lib/sanction/principal/grant.rb
View
@@ -40,9 +40,11 @@ def give_permissionable_role(role_name, over)
if(over.class == Class)
role_to_create = self.specific_principal_roles.build(:name => role_name.to_s, :permissionable_id => nil, :permissionable_type => over.to_s)
+ role_to_create.principal_type = self.class.name
role_to_create.save
else
role_to_create = self.specific_principal_roles.build(:name => role_name.to_s, :permissionable_id => over.id, :permissionable_type => over.class.to_s)
+ role_to_create.principal_type = self.class.name
role_to_create.save
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.