Your model needs a method storage_name like :
def self.storage_name(repository)
"your_legacy_table_name"
end
Repository can be ignored if you are just dealing with one database.
ps: afcool83 mentioned a smarter way to do this:
storage_names[:default]='your_legacy_table_name'
2 Kommentare:
You can do
class User
include DataMapper::Resource
storage_names[:default]='your_legacy_table_name'
# properties here....
end
thats way cooler, thanks!
Kommentar veröffentlichen