delayed_job_couchrest_model 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ require 'couchrest_model'
2
+
3
+ #extent couchrest to handle delayed_job serialization.
4
+ class CouchRest::Model::Base
5
+ yaml_as "tag:ruby.yaml.org,2002:CouchRest"
6
+
7
+ def self.yaml_new(klass, tag, val)
8
+ klass.get(val['_id'])
9
+ end
10
+ def to_yaml_properties
11
+ ['@id']
12
+ end
13
+ def ==(other)
14
+ if other.is_a? ::CouchRest::Model::Base
15
+ self['_id'] == other['_id']
16
+ else
17
+ super
18
+ end
19
+ end
20
+ end
@@ -1,5 +1,6 @@
1
1
  require 'couchrest_model'
2
2
  require 'delayed_job'
3
+ require 'delayed/serialization/couchrest_model'
3
4
  require 'delayed/backend/couchrest_model'
4
5
 
5
6
  Delayed::Worker.backend = :couchrest_model
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job_couchrest_model
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - GTen
@@ -73,6 +73,7 @@ extra_rdoc_files:
73
73
  - README.md
74
74
  files:
75
75
  - lib/delayed/backend/couchrest_model.rb
76
+ - lib/delayed/serialization/couchrest_model.rb
76
77
  - lib/delayed_job_couchrest_model.rb
77
78
  - spec/delayed_job_couch_rest_spec.rb
78
79
  - spec/spec.opts