marples 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,10 @@ module Marples
3
3
  TRANSACTION_ACTIONS = :create, :update, :destroy
4
4
  CALLBACKS = TRANSACTION_ACTIONS + [:save, :commit]
5
5
 
6
+ def broadcast_action(callback_action)
7
+ self.class.marples_client.send callback_action, self
8
+ end
9
+
6
10
  def self.included base
7
11
  base.class_eval do
8
12
  # Something that response to #subscribe and #publish - although we
@@ -20,7 +24,7 @@ module Marples
20
24
  after_callback = "after_#{callback}"
21
25
  next unless respond_to? after_callback
22
26
 
23
- notify = lambda { |record| record.class.marples_client.send callback_action, record }
27
+ notify = lambda { |record| record.broadcast_action(callback_action) }
24
28
  if TRANSACTION_ACTIONS.include?(callback) && respond_to?(:after_commit)
25
29
  after_commit :on => callback, &notify
26
30
  else
@@ -1,3 +1,3 @@
1
1
  module Marples
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
21
21
  s.add_runtime_dependency "activesupport"
22
22
  s.add_runtime_dependency 'i18n'
23
23
  s.add_development_dependency 'rake'
24
- s.add_development_dependency 'activerecord'
24
+ s.add_development_dependency 'activerecord', '~> 3.1.0'
25
25
  s.add_development_dependency 'activerecord-nulldb-adapter'
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marples
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-12-20 00:00:00.000000000Z
13
+ date: 2012-04-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: null_logger
17
- requirement: &70142564751640 !ruby/object:Gem::Requirement
17
+ requirement: &70185231864760 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70142564751640
25
+ version_requirements: *70185231864760
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activesupport
28
- requirement: &70142564750780 !ruby/object:Gem::Requirement
28
+ requirement: &70185231863920 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70142564750780
36
+ version_requirements: *70185231863920
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: i18n
39
- requirement: &70142564750000 !ruby/object:Gem::Requirement
39
+ requirement: &70185231863020 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70142564750000
47
+ version_requirements: *70185231863020
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rake
50
- requirement: &70142564748880 !ruby/object:Gem::Requirement
50
+ requirement: &70185231862160 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,21 +55,21 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *70142564748880
58
+ version_requirements: *70185231862160
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: activerecord
61
- requirement: &70142564741580 !ruby/object:Gem::Requirement
61
+ requirement: &70185231861340 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
- - - ! '>='
64
+ - - ~>
65
65
  - !ruby/object:Gem::Version
66
- version: '0'
66
+ version: 3.1.0
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *70142564741580
69
+ version_requirements: *70185231861340
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: activerecord-nulldb-adapter
72
- requirement: &70142564740720 !ruby/object:Gem::Requirement
72
+ requirement: &70185231860420 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,7 +77,7 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *70142564740720
80
+ version_requirements: *70185231860420
81
81
  description: Message destination arbiter
82
82
  email:
83
83
  - craig@barkingiguana.com
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  requirements: []
123
123
  rubyforge_project: marples
124
- rubygems_version: 1.8.10
124
+ rubygems_version: 1.8.17
125
125
  signing_key:
126
126
  specification_version: 3
127
127
  summary: Message destination arbiter