Skip to content

Commit

Permalink
RAILS_DEFAULT_LOGGER creates a warning on rails 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sunkencity authored and stffn committed Apr 21, 2011
1 parent 890b7e2 commit e891e44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/declarative_authorization/authorization.rb
Expand Up @@ -241,8 +241,8 @@ def roles_for (user)
raise AuthorizationUsageError, "User object doesn't respond to roles (#{user.inspect})" \
if !user.respond_to?(:role_symbols) and !user.respond_to?(:roles)

RAILS_DEFAULT_LOGGER.info("The use of user.roles is deprecated. Please add a method " +
"role_symbols to your User model.") if defined?(RAILS_DEFAULT_LOGGER) and !user.respond_to?(:role_symbols)
Rails.logger.info("The use of user.roles is deprecated. Please add a method " +
"role_symbols to your User model.") if defined?(Rails) and Rails.respond_to?(:logger) and !user.respond_to?(:role_symbols)

roles = user.respond_to?(:role_symbols) ? user.role_symbols : user.roles

Expand Down

0 comments on commit e891e44

Please sign in to comment.