0
我有一個方法,定義如下:如何通過方法我可以更改屬性名稱?
def foobar(arg)
FactoryGirl.create(:user, arg: nil)
end
當我打電話foobar('email')
或foobar('name')
我希望我的方法返回此 FactoryGirl.create(:user, email: nil)
或FactoryGirl.create(:user, name: nil)
分別
我該怎麼辦呢?
對不起,我英文不好
謝謝!太簡單了,我在一個小時內試圖做 – wweare