Ruby on rails Rails中的延迟方法是什么?它来自哪个图书馆?
我看到这个代码:Ruby on rails Rails中的延迟方法是什么?它来自哪个图书馆?,ruby-on-rails,Ruby On Rails,我看到这个代码: Event.delay.create!( event_type: event_type, description: 'Automatically populated', date: Time.now.utc, eventable_id: subscription.id, eventable_type: subscription.class.name, app_context: app_context) 这是相关的测试: it 'logs event
Event.delay.create!(
event_type: event_type,
description: 'Automatically populated',
date: Time.now.utc,
eventable_id: subscription.id,
eventable_type: subscription.class.name,
app_context: app_context)
这是相关的测试:
it 'logs events' do
expect(Event).to receive(:delay).and_call_original
subject
end
什么是and_调用_原始方法?什么是延迟方法?延迟方法可能来自延迟作业,一种排队框架: “and_call_original”是rspec框架中的委托人 Sidekiq