内部の更新、私は私のモデル内の更新を作りたいRailsのモデルと、ArgumentError
self => BookingService(id: integer, currency_code: string, total_price: integer, group_total: integer, other attrs)
が、私はupdate(total_price:1,group_total:1)
を作ったとき、それが起きているのはなぜ
ArgumentError: wrong number of arguments (1 for 2)
[37] pry(BookingService)> update(total_price:1,group_total:1)
ArgumentError: wrong number of arguments (1 for 2)
from /Users/xx/.rvm/gems/[email protected]_api/gems/activerecord-4.1.13/lib/active_record/relation.rb:352:in `update'
[38] pry(BookingService)> self.update(total_price:1,group_total:1)
ArgumentError: wrong number of arguments (1 for 2)
from /Users/xxx/.rvm/gems/[email protected]_api/gems/activerecord-4.1.13/lib/active_record/relation.rb:352:in `update'
を持っていますか?ここで
が 'ここで何をself'されますか?モデルメソッドを呼び出して属性を更新する方法を示すコードを追加します。 – dp7