This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BidOfferedJob < Struct.new(:bid_id) | |
PRIORITY = 1 | |
def self.enqueue(bid) | |
Delayed::Job.enqueue new(bid.id), priority: PRIORITY | |
end | |
def perform | |
Mailer.bid_offered(owner, bid).deliver | |
Activity.create activity_type: 'bid_offered', subject: bid, user: aide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "spec_helper" | |
describe ExampleController do | |
context "GET #index" do | |
let(:resources) { FactoryGirl.create_list(:resource) } | |
before do | |
get :index | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DelayedJob | |
module Matchers | |
def enqueue_delayed_job(handler) | |
DelayedJobMatcher.new handler | |
end | |
class DelayedJobMatcher | |
def initialize(handler) | |
@handler = handler | |
@attributes = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--colour | |
-I app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateLocations < ActiveRecord::Migration | |
def self.up | |
create_table :locations do |t| | |
t.datetime :time | |
t.point :geom, :null => false, :srid => 4326, :with_z => true | |
t.float :speed | |
end | |
end | |
def self.down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Message | |
def deliver_to(mailbox) | |
mailbox.new_mail(self) | |
end | |
end | |
class Mailbox | |
def initialize |