Ruby on Rails: make LoginEngine fixtures dynamic
June 24th, 2006
admin:
id: 1
login: admin
salted_password: <%= LoginEngine::AuthenticatedUser.salted_password
(LoginEngine::AuthenticatedUser.hashed("salt-#{Time.now}"), LoginEngine::AuthenticatedUser.hashed('atest')) %>
salt: <%= LoginEngine::AuthenticatedUser.hashed("salt-#{Time.now}") %>
email: admin@company.com
verified: 1
This way you always generate fixtures that behave correctly according to your salt and such. Otherwise I had problems when doing “rake load_fixture” in the development db (the login failed).
4 Responses to “Ruby on Rails: make LoginEngine fixtures dynamic”
1gabriele
June 25th, 2006 @ 05:25
I missed this: why LoginEngine over AAA ?
2Enrico Franchi
June 25th, 2006 @ 06:59
I don’t understand what you mean with AAA
3gabriele
June 25th, 2006 @ 13:17
ouch, sorry, I meant acts_as_authenticated: http://technoweenie.stikipad.com/plugins/show/Acts+as+Authenticated
4Enrico Franchi
June 25th, 2006 @ 17:05
Because I use UserEngine on top of LoginEngine. So I get role based authentication. This gives me great degree of flexibility.
However, I have to admit I’m not completely happy with UserEngine. It “gets a lot in the way” and is probably an overkill. In fact it is probably not the right thing for me. Probably I have to give a try to AAA.
And I need to modify the way UE works: I need to add the concept of “ownership”.
Leave a Reply