I\'m developing a Rails 3 app using Devise and CanCan.
The app allows anonymous (not registered) users to access some of the app, and registered users to access other par
I'm also working on a rails 3 project w/ devise and cancan. My needs are a little different in that I need to persist anonymous users' activity in the db (no need to sweep). Here's what I did to sign in the anonymous user. Hope this helps.
def sign_in_anonymous_user
unless user_signed_in?
user = User.new
role = "anonymous"
user.confirmed_at = Time.now-1.minute
user.save :validate => false
sign_in :user, user
end
end