【发布时间】:2011-01-16 23:35:51
【问题描述】:
在DataMapper documentation for associations 中,我找到了一个示例,他们将模型放入...
1 class Person
2
3 class Link
4
5 include DataMapper::Resource
6
7 storage_names[:default] = 'people_links'
8
9 # the person who is following someone
10 belongs_to :follower, 'Person', :key => true
11
12 # the person who is followed by someone
13 belongs_to :followed, 'Person', :key => true
14
15 end
16
17 include DataMapper::Resource
18
19 property :id, Serial
20 property :name, String, :required => true
21 ...
它对您返回的结果有任何影响吗?还是只是另一种表示法或格式?
提前致谢,鲁弗斯
【问题讨论】:
标签: sinatra datamapper