Hi
I'm trying to reuse methods in DataMapper classes. This might be as well a ruby question I think.
class Foo
include DataMapper::Resource
property :name
property ...
def self.special_name
self.all(:name => 'whatever')
end
end
class Bar
include DataMapper::Resource
property :name
property ...
def self.special_name
self.all(:name => 'whatever')
end
end
So the method special_name would be used for both classes as I want to get out the same result. But it also makes use of DataMapper methods like "all". So how would you do this?
Thx