Permalink
Browse files

Merge branch 'master' of git://github.com/bjhess/restful-authentication

  • Loading branch information...
technoweenie committed Feb 21, 2009
2 parents ecf8386 + 61f377d commit 5799593a28bb88e98b8cfe32d2f207c753a2bd9b
Showing with 1 addition and 1 deletion.
  1. +1 −1 generators/authenticated/templates/authenticated_test_helper.rb
@@ -1,7 +1,7 @@
module AuthenticatedTestHelper
# Sets the current <%= file_name %> in the session from the <%= file_name %> fixtures.
def login_as(<%= file_name %>)
- @request.session[:<%= file_name %>_id] = <%= file_name %> ? <%= table_name %>(<%= file_name %>).id : nil
+ @request.session[:<%= file_name %>_id] = <%= file_name %> ? (<%= file_name %>.is_a?(<%= file_name.camelize %>) ? <%= file_name %>.id : <%= table_name %>(<%= file_name %>).id) : nil
end
def authorize_as(<%= file_name %>)

0 comments on commit 5799593

Please sign in to comment.