0
找不到這是什麼問題。在irb中執行方法
def self.transfer(from, to, quantity)
transaction(from, to) do
from.withdraw(quantity)
to.deposit(quantity)
end
end
在控制檯這部作品
Stock.transaction do; sone.deposit(10); stwo.withdraw(10); end
但如果我不
Stock.transfer(sone, stwo, 10)
我收到ArgumentError: wrong number of arguments (2 for 1)
任何想法?