Displaying 2 results from an estimated 2 matches for "find_scope".
Did you mean:
finder_scope
2011 Nov 02
1
getting devise to return json data when signing out
...resource = warden.authenticate!(:scope =>
resource_name, :recall => "#{controller_path}#failure")
return sign_in_and_redirect(resource_name, resource)
}
end
end
def sign_in_and_redirect(resource_or_scope, resource=nil)
scope = Devise::Mapping.find_scope!(resource_or_scope)
resource ||= resource_or_scope
sign_in(scope, resource) unless warden.user(scope) == resource
return render :json => { :success => true, :redirect =>
stored_location_for(scope) || after_sign_in_path_for(resource)}
end
def failure
retur...
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around
filter. I have defined expectations on the model classes, and ideally, I
would add a further expectation for the scope. Is this already possible
in some way? How would I go about adding support a scope expectation?
Michael
--
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/