Is there a way to get the properties of a model with DataMapper? For example:
require 'rubygems'
require 'datamapper'
class User
include DataMapper::Resource
property :id, Serial
property :name, String
end
Could I get the properties of User in an array or a hash?
Yes, you can get them with
it will return an instance of PropertySet which you can cast into an Array if you want.