Skip to content

Commit

Permalink
patch to eliminate direct ActiveRecord class check
Browse files Browse the repository at this point in the history
  • Loading branch information
cail committed May 28, 2010
1 parent 1960b23 commit 6b94ec7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/monkeys/authlogic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ def acts_as_authentic

end


# Bad authlogic interface! patching!
module Authlogic::Session::UnauthorizedRecord
def credentials=(value)
super
values = value.is_a?(Array) ? value : [value]
if ![String, Symbol, Hash].find{|e| values.first.kind_of? e }
# !values.first.kind_of? String and !values.first.kind_of? Symbol and !values.first.kind_of? Hash
self.unauthorized_record = values.first
end
end
end

0 comments on commit 6b94ec7

Please sign in to comment.