Skip to content

Commit

Permalink
new version of fix, compatible with commit aa2471a
Browse files Browse the repository at this point in the history
  • Loading branch information
oseiskar committed Jan 14, 2015
2 parents 274611a + c34d783 commit a9aaba2
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
AbcSize:
Enabled: false

# Enforce outdenting of access modifiers (i.e. public, private, protected)
AccessModifierIndentation:
EnforcedStyle: outdent
Expand Down Expand Up @@ -65,6 +68,9 @@ MethodLength:
CountComments: false
Max: 53

MultilineOperationIndentation:
EnforcedStyle: indented

# Avoid long parameter lists
ParameterLists:
Max: 4
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
- RAILS_VERSION="~> 3.2.0"
- RAILS_VERSION="~> 4.0.0"
- RAILS_VERSION="~> 4.1.0"
- RAILS_VERSION="~> 4.2.0"
- RAILS_VERSION="edge"
rvm:
- 1.9.3
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
4.0.6 - 2014-12-22
==================
* Revert removing test files from the gem

4.0.5 - 2014-12-22
==================
* Support for Rails 4.2
* Allow user to override where DJ writes log output
* First attempt at automatic code reloading
* Clearer error message when ActiveRecord object no longer exists
* Various improvements to the README

4.0.4 - 2014-09-24
==================
* Fix using options passed into delayed_job command
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ group :test do
gem 'activerecord', :github => 'rails/rails'
gem 'actionmailer', :github => 'rails/rails'
else
gem 'activerecord', (ENV['RAILS_VERSION'] || ['>= 3.0', '< 4.2'])
gem 'actionmailer', (ENV['RAILS_VERSION'] || ['>= 3.0', '< 4.2'])
gem 'activerecord', (ENV['RAILS_VERSION'] || ['>= 3.0', '< 5.0'])
gem 'actionmailer', (ENV['RAILS_VERSION'] || ['>= 3.0', '< 5.0'])
end

gem 'coveralls', :require => false
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ class LongTasks
2.hours.from_now
end

def call_a_class_method
# Some other code
class << self
def call_a_class_method
# Some other code
end
handle_asynchronously :call_a_class_method, :run_at => Proc.new { when_to_run }
end
handle_asynchronously :call_a_class_method, :run_at => Proc.new { when_to_run }

attr_reader :how_important

Expand Down
9 changes: 5 additions & 4 deletions delayed_job.gemspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Gem::Specification.new do |spec|
spec.add_dependency 'activesupport', ['>= 3.0', '< 4.2']
spec.add_dependency 'activesupport', ['>= 3.0', '< 5.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 = ['[email protected]']
spec.files = %w[CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md delayed_job.gemspec]
spec.files += Dir['{contrib,lib,recipes}/**/*']
spec.files = %w[CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md Rakefile delayed_job.gemspec]
spec.files += Dir.glob('{contrib,lib,recipes,spec}/**/*')
spec.homepage = 'http://github.com/collectiveidea/delayed_job'
spec.licenses = ['MIT']
spec.name = 'delayed_job'
spec.require_paths = ['lib']
spec.summary = 'Database-backed asynchronous priority queue system -- Extracted from Shopify'
spec.version = '4.0.4'
spec.test_files = Dir.glob('spec/**/*')
spec.version = '4.0.6'
end
4 changes: 3 additions & 1 deletion lib/delayed/psych_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def visit_Psych_Nodes_Mapping(object) # rubocop:disable CyclomaticComplexity, Me
when /^!ruby\/object/
result = super
if defined?(ActiveRecord::Base) && result.is_a?(ActiveRecord::Base)
klass = result.class
id = result[klass.primary_key]
begin
result.class.unscoped.find(result[result.class.primary_key])
klass.unscoped.find(id)
rescue ActiveRecord::RecordNotFound => error # rubocop:disable BlockNesting
raise Delayed::DeserializationError, "ActiveRecord::RecordNotFound, class: #{klass}, primary key: #{id} (#{error.message})"
end
Expand Down
2 changes: 0 additions & 2 deletions lib/delayed/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@
if unprocessed_jobs > 0
raise "#{unprocessed_jobs} jobs older than #{args[:max_age]} seconds have not been processed yet"
end

end

end
1 change: 0 additions & 1 deletion spec/performable_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ def signup(email)
end
end
end

end

0 comments on commit a9aaba2

Please sign in to comment.