我有这个工厂:
FactoryGirl.define do
factory :from_sector, class: Sector do
sequence(:name) { |n| name "gti#{n}" }
end
end
但是当我这样做时:
from = FactoryGirl.create(:from_sector)
from.name #=> <Sector id: 9, name: #<FactoryGirl::Declaration::Static:0x00000002d13650 @name=:name, @ignored=false, @value="gti1">, created_at: "2012-06-15 17:24:05", updated_at: "2012-06-15 17:24:05">
“from.name”不应该返回“gti1”吗?