Browse files

added respond_to? check, bumped tiny

  • Loading branch information...
1 parent 0f3a8a2 commit fb2e750eb82257c6529a3806163cf28cf1e0bc74 @matthewvermaak committed Dec 3, 2009
Showing with 3 additions and 3 deletions.
  1. +2 −2 app/models/sanction/role/definition.rb
  2. +1 −1 lib/sanction/version.rb
View
4 app/models/sanction/role/definition.rb
@@ -110,7 +110,7 @@ def self.valid_role?(principal, role_name, permissionable = nil)
end
def self.valid_principal?(principal_klass)
- if (not principal_klass.is_a? Class) and principal_klass.new_record?
+ if (not principal_klass.is_a? Class) and principal_klass.respond_to?( :new_record? ) and principal_klass.new_record?
false
else
principal_klass = principal_klass.class unless principal_klass.is_a? Class
@@ -120,7 +120,7 @@ def self.valid_principal?(principal_klass)
end
def self.valid_permissionable?(permissionable_klass)
- if (not permissionable_klass.is_a? Class) and permissionable_klass.new_record?
+ if (not permissionable_klass.is_a? Class) and permissionable_klass.respond_to?( :new_record? ) and permissionable_klass.new_record?
false
else
permissionable_klass = permissionable_klass.class unless permissionable_klass.is_a? Class
View
2 lib/sanction/version.rb
@@ -2,7 +2,7 @@ module Sanction
module Version
MAJOR = 1
MINOR = 0
- TINY = 1
+ TINY = 2
STRING = [MAJOR, MINOR, TINY].join('.')
end

0 comments on commit fb2e750

Please sign in to comment.