Datamapper, defining your own object methods, how?
- by Dublinclontarf
So lets say I have a class like below
class List
include DataMapper::Resource
property :id, Serial
property :username, String
def self.my_username
return self[:username]
end
end
list=List.create(:username=>,'jim')
list.my_username
When I run this it tells me that the method cannot be found, and on more investigation that you…