promiscuous 0.11 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  class Promiscuous::Publisher::Mongoid < Promiscuous::Publisher::Base
2
- autoload :Embedded, 'promiscuous/publisher/mongoid/embedded'
3
- autoload :Defer, 'promiscuous/publisher/mongoid/defer'
2
+ autoload :Embedded, 'promiscuous/publisher/mongoid/embedded'
3
+ autoload :DeferEmbedded, 'promiscuous/publisher/mongoid/defer_embedded'
4
+ autoload :Defer, 'promiscuous/publisher/mongoid/defer'
4
5
 
5
6
  include Promiscuous::Publisher::Class
6
7
  include Promiscuous::Publisher::Attributes
@@ -11,7 +12,11 @@ class Promiscuous::Publisher::Mongoid < Promiscuous::Publisher::Base
11
12
  super
12
13
 
13
14
  if klass.embedded?
14
- include Promiscuous::Publisher::Mongoid::Embedded
15
+ if mongoid3?
16
+ include Promiscuous::Publisher::Mongoid::DeferEmbedded
17
+ else
18
+ include Promiscuous::Publisher::Mongoid::Embedded
19
+ end
15
20
  else
16
21
  include Promiscuous::Publisher::Model
17
22
  include Promiscuous::Publisher::Mongoid::Defer if mongoid3?
@@ -0,0 +1,21 @@
1
+ module Promiscuous::Publisher::Mongoid::DeferEmbedded
2
+ extend ActiveSupport::Concern
3
+
4
+ def payload
5
+ super.merge(:id => instance.id)
6
+ end
7
+
8
+ included do
9
+ klass.class_eval do
10
+ callback = proc do
11
+ if _parent.respond_to?(:promiscuous_publish_update)
12
+ _parent.promiscuous_publish_update
13
+ end
14
+ end
15
+
16
+ before_create callback
17
+ before_update callback
18
+ before_destroy callback
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module Promiscuous
2
- VERSION = '0.11'
2
+ VERSION = '0.11.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promiscuous
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.11'
4
+ version: 0.11.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-24 00:00:00.000000000 Z
13
+ date: 2012-10-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -106,6 +106,7 @@ files:
106
106
  - lib/promiscuous/publisher/envelope.rb
107
107
  - lib/promiscuous/publisher/mongoid/embedded.rb
108
108
  - lib/promiscuous/publisher/mongoid/defer.rb
109
+ - lib/promiscuous/publisher/mongoid/defer_embedded.rb
109
110
  - lib/promiscuous/publisher/active_record.rb
110
111
  - lib/promiscuous/publisher/attributes.rb
111
112
  - lib/promiscuous/publisher/base.rb
@@ -121,9 +122,9 @@ files:
121
122
  - lib/promiscuous/publisher/amqp.rb
122
123
  - lib/promiscuous/publisher/error.rb
123
124
  - lib/promiscuous/publisher/model.rb
124
- - lib/promiscuous/publisher/mongoid.rb
125
125
  - lib/promiscuous/publisher/worker.rb
126
126
  - lib/promiscuous/publisher/ephemeral.rb
127
+ - lib/promiscuous/publisher/mongoid.rb
127
128
  - lib/promiscuous/railtie/replicate.rake
128
129
  - lib/promiscuous/subscriber/envelope.rb
129
130
  - lib/promiscuous/subscriber/error.rb