views:

54

answers:

1

I'm in the process of replacing ActiveRecord with DataMapper in one of my apps. Since there aren't any authentication solutions that are compatable with DataMapper, I'm thinking that I could use ActiveRecord just for user authentication, and then use DataMapper everywhere else. I'd like to have both ORMs interacting with the same database. Is something like this possible? I'd appreciate any help.

+1  A: 

Yes, it is possible to use both on the same database, and even on the same table.

However, when you use them on the same table, you should be aware that the caching mechanisms that are used for loading records may break if you modify a user with Datamapper, and then access it again with ActiveRecord. You may get the cached record, instead of the updated record with the new password, for instance. You can overcome this by using the "force reload" option, or disable caching completely for ActiveRecord.

Finally, I urge you to submit bug reports / feature requests to the authentication solution you want to use to also support DataMapper :-)

wvanbergen