Permalink
Browse files

fixed bug that prevented ActiveRecord.model_name to work with Rails 2…

….3.x

Signed-off-by: Ben Johnson <bjohnson@binarylogic.com>
  • Loading branch information...
1 parent faa063f commit 73c4cccb38189f0e52e1e362992dfb9db7d1206f @dcrec1 dcrec1 committed with binarylogic Aug 17, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/authlogic/session/active_record_trickery.rb
@@ -40,7 +40,8 @@ def self_and_descendants_from_active_record
# For rails >3.0
def model_name
- ActiveModel::Name.new(self.to_s)
+ clazz = defined?(ActiveModel) ? ActiveModel::Name : ActiveSupport::ModelName
+ clazz.new(self.to_s)
end
end

0 comments on commit 73c4ccc

Please sign in to comment.