Freitag, Oktober 31, 2008

legacy databases with datamapper

For my current project I choose datamapper wich has some advantages over ActiveRecord. I need a thread safe ORM which doesnt need to do much but performing real fast. I am dealing with legacy table names but couldnt find any documentation how this is done though its very simple:

Your model needs a method storage_name like :

def self.storage_name(repository)

Repository can be ignored if you are just dealing with one database.

ps: afcool83 mentioned a smarter way to do this:



afcool83 hat gesagt…

You can do

class User
include DataMapper::Resource
# properties here....

Martin Wöginger hat gesagt…

thats way cooler, thanks!