1
使用機械師,是否有某種方法可以定義藍圖,使他們繼承其他藍圖的屬性?我查看了所有我找到的文檔和示例,但我沒有看到它發生。在機械師藍圖中繼承屬性
我想要做這樣的事情:
User.blueprint do
name
email
end
User.blueprint(:admin) do
is_admin { true }
end
User.blueprint(:editor) do
is_editor { true }
group
end
User.blueprint(:contributor) do
is_editor { true }
end
,他們也都從第一個藍圖繼承名/電子郵件和:contibutor藍圖繼承了組屬性:編輯藍圖。
這可能嗎?
謝謝!當我查閱文檔時,我從來沒有發現關於命名藍圖的那一點 – u2622 2011-03-03 16:51:02