promiscuous 0.8.9 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,9 +12,15 @@ module Promiscuous::Subscriber::Attributes
12
12
  end
13
13
 
14
14
  value = payload[attr]
15
- old_value = instance.__send__(attr)
16
- new_value = Promiscuous::Subscriber.process(payload[attr], :old_value => old_value)
17
- instance.__send__("#{attr}=", new_value) if old_value != new_value
15
+
16
+ if instance.respond_to?(attr)
17
+ old_value = instance.__send__(attr)
18
+ new_value = Promiscuous::Subscriber.process(payload[attr], :old_value => old_value)
19
+ instance.__send__("#{attr}=", new_value) if old_value != new_value
20
+ else
21
+ # TODO Add unit test
22
+ instance.__send__("#{attr}=", new_value)
23
+ end
18
24
  end
19
25
  end
20
26
 
@@ -1,3 +1,3 @@
1
1
  module Promiscuous
2
- VERSION = '0.8.9'
2
+ VERSION = '0.9.0'
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.8.9
4
+ version: 0.9.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -110,7 +110,6 @@ files:
110
110
  - lib/promiscuous/subscriber/mongoid/embedded.rb
111
111
  - lib/promiscuous/subscriber/active_record.rb
112
112
  - lib/promiscuous/subscriber/amqp.rb
113
- - lib/promiscuous/subscriber/attributes.rb
114
113
  - lib/promiscuous/subscriber/lint.rb
115
114
  - lib/promiscuous/subscriber/lint/amqp.rb
116
115
  - lib/promiscuous/subscriber/lint/base.rb
@@ -123,6 +122,7 @@ files:
123
122
  - lib/promiscuous/subscriber/model.rb
124
123
  - lib/promiscuous/subscriber/class.rb
125
124
  - lib/promiscuous/subscriber/polymorphic.rb
125
+ - lib/promiscuous/subscriber/attributes.rb
126
126
  - lib/promiscuous/config.rb
127
127
  - lib/promiscuous/amqp.rb
128
128
  - lib/promiscuous/common/lint.rb