开发者

How can I a make model acts_as_authentic that doesn't have the persistence_token field or related functionality?

I would like to use only the perishable_token feature from authlogic on this开发者_如何转开发 model and nothing else. Here's what I've tried so far that's failed:

class EmailInvite < ActiveRecord::Base
  acts_as_authentic do |c|
    c.disable_perishable_token_maintenance = true
    c.maintain_sessions = false
  end
end

I'd appreciate any help.


Ended up just using Authlogic::Random.friendly_token to generate the token and then did everything else outside of authlogic:

class EmailInviteObserver < ActiveRecord::Observer

    def after_create(email_invite)
      email_invite.perishable_token = Authlogic::Random.friendly_token
      email_invite.save
    end

end
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜