Skip to content

Commit

Permalink
Merge pull request #490 from hasimo/rails4
Browse files Browse the repository at this point in the history
support for rails 4.0
  • Loading branch information
sferik committed Mar 2, 2013
2 parents b90a3a4 + 21b7956 commit ebf70f0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Expand Up @@ -12,8 +12,8 @@ platforms :jruby do
end

group :test do
gem 'activerecord', '~> 3.0'
gem 'actionmailer', '~> 3.0'
gem 'activerecord', '>= 3.0'
gem 'actionmailer', '>= 3.0'
gem 'rspec', '>= 2.11'
gem 'simplecov', :require => false
gem 'coveralls', :require => false
Expand Down
2 changes: 1 addition & 1 deletion delayed_job.gemspec
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-

Gem::Specification.new do |spec|
spec.add_dependency 'activesupport', '~> 3.0'
spec.add_dependency 'activesupport', '>= 3.0'
spec.authors = ["Brandon Keepers", "Brian Ryckbost", "Chris Gaffney", "David Genord II", "Erik Michaels-Ober", "Matt Griffin", "Steve Richert", "Tobias Lütke"]
spec.description = "Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks."
spec.email = ['brian@collectiveidea.com']
Expand Down
15 changes: 13 additions & 2 deletions lib/delayed/message_sending.rb
@@ -1,8 +1,19 @@
require 'active_support/basic_object'
if ActiveSupport::VERSION::MAJOR == 4
require 'active_support/proxy_object'
else
require 'active_support/basic_object'
end

require 'active_support/core_ext/module/aliasing'

module Delayed
class DelayProxy < ActiveSupport::BasicObject
if ActiveSupport::VERSION::MAJOR == 4
klass = ActiveSupport::ProxyObject
else
klass = ActiveSupport::BasicObject
end

class DelayProxy < klass
def initialize(payload_class, target, options)
@payload_class = payload_class
@target = target
Expand Down
2 changes: 1 addition & 1 deletion lib/delayed_job.rb
Expand Up @@ -6,7 +6,7 @@
# PerformableMailer is compatible with ActionMailer 3 (and possibly 3.1)
if defined?(ActionMailer)
require 'action_mailer/version'
require 'delayed/performable_mailer' if 3 == ActionMailer::VERSION::MAJOR
require 'delayed/performable_mailer' if ActionMailer::VERSION::MAJOR >= 3
end

require 'delayed/yaml_ext'
Expand Down
2 changes: 1 addition & 1 deletion spec/performable_mailer_spec.rb
Expand Up @@ -3,7 +3,7 @@
require 'action_mailer'
class MyMailer < ActionMailer::Base
def signup(email)
mail :to => email, :subject => "Delaying Emails", :from => "delayedjob@example.com"
mail :to => email, :subject => "Delaying Emails", :from => "delayedjob@example.com",:body => 'Delaying Emails Body'
end
end

Expand Down

0 comments on commit ebf70f0

Please sign in to comment.