Grape and delayed_job

64 views
Skip to first unread message

a...@substantial.com

unread,
Mar 21, 2013, 12:58:22 PM3/21/13
to ruby-...@googlegroups.com
I have an API endpoint that should add a task to a delayed_job queue. Has anyone successfully integrated Grape and delayed_job? 

Here's the approximate code I want to run:

module API::Endpoints
  class InvitationsAPI < Grape::API
    version 'v1', using: :path

    format :json

    resource :invitation do
      post '/user' do
        InvitationMailer.delay.send_invite(params[:email])
        "Invitation Sent"
      end
    end
  end
end

The delay method doesn't exist on InvitationMailer and so that line fails. If I remove "delay" everything is successful.

Thanks in advance,

Aja

Daniel Doubrovkine

unread,
Mar 22, 2013, 8:01:38 AM3/22/13
to ruby-...@googlegroups.com
We've been using DJ with Grape without any problems and without doing anything special. If you build a small repro I could take a look.


--
You received this message because you are subscribed to the Google Groups "Grape Framework Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-grape+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

dB. | Moscow - Geneva - Seattle - New York
dblock.org - @dblockdotorg

Евгений Куртов

unread,
May 6, 2013, 10:25:56 AM5/6/13
to ruby-...@googlegroups.com
With Rails? 

пятница, 22 марта 2013 г., 14:01:38 UTC+2 пользователь Daniel Doubrovkine написал:

Daniel Doubrovkine

unread,
May 6, 2013, 11:34:34 AM5/6/13
to ruby-...@googlegroups.com
yes
Reply all
Reply to author
Forward
0 new messages