ar-resque-counter-cache 2.0.3 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_dependency "activerecord", "~> 3.0"
22
+ s.add_dependency "activerecord", "~> 3.1"
23
23
  s.add_dependency "resque", "~> 1.0"
24
24
  s.add_dependency "resque-lock-timeout", "~> 0.3.1"
25
25
 
@@ -7,7 +7,7 @@ module ArAsyncCounterCache
7
7
  reflection = self.class.reflect_on_association(association_id)
8
8
  parent_class = reflection.klass
9
9
  column = self.class.async_counter_types[association_id]
10
- if parent_id = send(reflection.primary_key_name)
10
+ if parent_id = send(reflection.foreign_key)
11
11
  ArAsyncCounterCache::IncrementCountersWorker.cache_and_enqueue(parent_class, parent_id, column, dir)
12
12
  end
13
13
  end
@@ -29,7 +29,7 @@ module ArAsyncCounterCache
29
29
  # Let's make the column read-only like the normal belongs_to
30
30
  # counter_cache.
31
31
  parent_class.send(:attr_readonly, column.to_sym) if defined?(parent_class) && parent_class.respond_to?(:attr_readonly)
32
- parent_id_column = reflection.primary_key_name
32
+ parent_id_column = reflection.foreign_key
33
33
  add_callbacks(parent_class.to_s, parent_id_column, column)
34
34
  end
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module ArAsyncCounterCache
2
- VERSION = "2.0.3"
2
+ VERSION = "2.1.0"
3
3
  end
metadata CHANGED
@@ -1,110 +1,79 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ar-resque-counter-cache
3
- version: !ruby/object:Gem::Version
4
- hash: 9
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.0
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 0
9
- - 3
10
- version: 2.0.3
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Aaron Gibralter
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-09-04 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-09-07 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: activerecord
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &2153292200 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 7
29
- segments:
30
- - 3
31
- - 0
32
- version: "3.0"
20
+ - !ruby/object:Gem::Version
21
+ version: '3.1'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: resque
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *2153292200
25
+ - !ruby/object:Gem::Dependency
26
+ name: resque
27
+ requirement: &2153291700 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
29
+ requirements:
41
30
  - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 15
44
- segments:
45
- - 1
46
- - 0
47
- version: "1.0"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
48
33
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: resque-lock-timeout
52
34
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *2153291700
36
+ - !ruby/object:Gem::Dependency
37
+ name: resque-lock-timeout
38
+ requirement: &2153291220 !ruby/object:Gem::Requirement
54
39
  none: false
55
- requirements:
40
+ requirements:
56
41
  - - ~>
57
- - !ruby/object:Gem::Version
58
- hash: 17
59
- segments:
60
- - 0
61
- - 3
62
- - 1
42
+ - !ruby/object:Gem::Version
63
43
  version: 0.3.1
64
44
  type: :runtime
65
- version_requirements: *id003
66
- - !ruby/object:Gem::Dependency
67
- name: rspec
68
45
  prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *2153291220
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: &2153290740 !ruby/object:Gem::Requirement
70
50
  none: false
71
- requirements:
51
+ requirements:
72
52
  - - ~>
73
- - !ruby/object:Gem::Version
74
- hash: 31
75
- segments:
76
- - 2
77
- - 4
78
- - 0
53
+ - !ruby/object:Gem::Version
79
54
  version: 2.4.0
80
55
  type: :development
81
- version_requirements: *id004
82
- - !ruby/object:Gem::Dependency
83
- name: sqlite3-ruby
84
56
  prerelease: false
85
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *2153290740
58
+ - !ruby/object:Gem::Dependency
59
+ name: sqlite3-ruby
60
+ requirement: &2153290280 !ruby/object:Gem::Requirement
86
61
  none: false
87
- requirements:
62
+ requirements:
88
63
  - - ~>
89
- - !ruby/object:Gem::Version
90
- hash: 29
91
- segments:
92
- - 1
93
- - 3
94
- - 3
64
+ - !ruby/object:Gem::Version
95
65
  version: 1.3.3
96
66
  type: :development
97
- version_requirements: *id005
98
- description: Increment ActiveRecord's counter cache column asynchronously using Resque (and resque-lock-timeout).
99
- email:
67
+ prerelease: false
68
+ version_requirements: *2153290280
69
+ description: Increment ActiveRecord's counter cache column asynchronously using Resque
70
+ (and resque-lock-timeout).
71
+ email:
100
72
  - aaron.gibralter@gmail.com
101
73
  executables: []
102
-
103
74
  extensions: []
104
-
105
75
  extra_rdoc_files: []
106
-
107
- files:
76
+ files:
108
77
  - .gitignore
109
78
  - Gemfile
110
79
  - LICENSE
@@ -122,38 +91,30 @@ files:
122
91
  - spec/spec_helper.rb
123
92
  homepage: http://github.com/agibralter/ar-resque-counter-cache
124
93
  licenses: []
125
-
126
94
  post_install_message:
127
95
  rdoc_options: []
128
-
129
- require_paths:
96
+ require_paths:
130
97
  - lib
131
- required_ruby_version: !ruby/object:Gem::Requirement
98
+ required_ruby_version: !ruby/object:Gem::Requirement
132
99
  none: false
133
- requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- hash: 3
137
- segments:
138
- - 0
139
- version: "0"
140
- required_rubygems_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
105
  none: false
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- hash: 3
146
- segments:
147
- - 0
148
- version: "0"
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
149
110
  requirements: []
150
-
151
111
  rubyforge_project: ar-resque-counter-cache
152
112
  rubygems_version: 1.8.10
153
113
  signing_key:
154
114
  specification_version: 3
155
- summary: Increment ActiveRecord's counter cache column asynchronously using Resque (and resque-lock-timeout).
156
- test_files:
115
+ summary: Increment ActiveRecord's counter cache column asynchronously using Resque
116
+ (and resque-lock-timeout).
117
+ test_files:
157
118
  - spec/ar_resque_counter_cache/active_record_spec.rb
158
119
  - spec/integration_spec.rb
159
120
  - spec/models.rb