私はクラス GoodsTransaction を持っています:
require Rails.root.join('lib','two_parties_transaction.rb')
class GoodsTransaction < Transaction
include TwoPartiesTransaction
def counterparty(org, loop = false)
res = #Some logic
res || super(org)
end
end
これには TwoPartiesTransaction モジュールが含まれます。
module TwoPartiesTransaction
extend ActiveSupport::Concern
included do
def counterparty(org)
#Some logic
end
end
end
カウンターパーティーの実行に失敗します:
muichkine@ubuntu:~/src/white$ rails c
Faraday::Builder is now Faraday::RackBuilder.
Loading development environment (Rails 4.0.0)
2.0.0p247 :001 > tr = GoodsTransaction.new
=> #<GoodsTransaction _id: 5264e2eb75627540dd000000, e(end_date): nil, p(span): nil, s(start_date): nil, u(span_unit): nil, _type: "GoodsTransaction", a(autobook): nil, c(forced_close): nil, d(public_id): nil, k(autobook_period): nil, l(label): nil, n(autobook_number): nil, t(autobook_until): nil, contact_ids: nil, parent_id: nil, fc(creditor): nil, fd(debtor): nil>
2.0.0p247 :002 > tr.counterparty(nil)
NoMethodError: super: no superclass method `counterparty' for #<GoodsTransaction:0x000000090fe1d8>
from /home/muichkine/src/white/app/models/transactions/goods_transaction.rb:148:in `counterparty'
スーパーカウンターパーティーメソッドをスキップするために私は何をしていますか?