Skip to content

Commit

Permalink
Replaced call to deprecated with_scope
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismaximin committed Mar 29, 2013
1 parent 6c69cb5 commit 4f7e8cf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/authlogic/session/scopes.rb
Expand Up @@ -91,7 +91,18 @@ def build_key(last_part)
end

def search_for_record(*args)
klass.send(:with_scope, :find => (scope[:find_options] || {})) do
where_content = nil
current_scope = nil

if scope.has_key?(:find_options)
if scope[:find_options].is_a?(Hash) and scope[:find_options].has_key?(:conditions)
where_content = scope[:find_options][:conditions]
elsif scope[:find_options].is_a?(ActiveRecord::Relation)
current_scope = scope[:find_options]
end
end

klass.send(:where, where_content).merge(current_scope).send(:scoping) do
klass.send(*args)
end
end
Expand Down

0 comments on commit 4f7e8cf

Please sign in to comment.