Permalink
Browse files

Robustisizing...

I think the original intention was to allow declaration like:
  config.principals = [Person, Group]
  # or
  config.principals = ["Person", "Group"]

The 2nd case would fail with previous code, and code is not necessary in the first case
  • Loading branch information...
1 parent 125a88b commit 4c416569282b9c10bb6f38d88bd179fba7813a76 @pjleonhardt pjleonhardt committed Jul 27, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/sanction.rb
View
@@ -74,13 +74,13 @@ def self.do_injections!
def self.inject_principals!
self.principals.each do |principal|
- principal.name.to_s.constantize.send(:include, Sanction::Principal)
+ principal.to_s.constantize.send(:include, Sanction::Principal)
end
end
def self.inject_permissionables!
self.permissionables.each do |permissionable|
- permissionable.name.to_s.constantize.send(:include, Sanction::Permissionable)
+ permissionable.to_s.constantize.send(:include, Sanction::Permissionable)
end
end
end

0 comments on commit 4c41656

Please sign in to comment.