primer 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. data/History.txt +5 -0
  2. data/example/db/blog.sqlite3 +0 -0
  3. data/lib/primer/worker/active_record_agent.rb +3 -4
  4. data/spec/db/test.sqlite3 +0 -0
  5. metadata +37 -68
  6. data/lib/primer/bus/amqp.rbc +0 -1045
  7. data/lib/primer/bus/memory.rbc +0 -344
  8. data/lib/primer/bus.rbc +0 -872
  9. data/lib/primer/cache/memory.rbc +0 -1443
  10. data/lib/primer/cache/redis.rbc +0 -1643
  11. data/lib/primer/cache.rbc +0 -1502
  12. data/lib/primer/enabler.rbc +0 -414
  13. data/lib/primer/helpers.rbc +0 -1438
  14. data/lib/primer/lazyness.rbc +0 -1442
  15. data/lib/primer/real_time.rbc +0 -1999
  16. data/lib/primer/route_set.rbc +0 -1475
  17. data/lib/primer/watcher/active_record_macros.rbc +0 -1796
  18. data/lib/primer/watcher/macros.rbc +0 -1628
  19. data/lib/primer/watcher.rbc +0 -1416
  20. data/lib/primer/worker/active_record_agent.rbc +0 -2840
  21. data/lib/primer/worker/changes_agent.rbc +0 -578
  22. data/lib/primer/worker.rbc +0 -1254
  23. data/lib/primer.rbc +0 -944
  24. data/spec/models/artist.rbc +0 -288
  25. data/spec/models/blog_post.rbc +0 -181
  26. data/spec/models/calendar.rbc +0 -209
  27. data/spec/models/concert.rbc +0 -211
  28. data/spec/models/performance.rbc +0 -177
  29. data/spec/models/person.rbc +0 -306
  30. data/spec/models/watchable.rbc +0 -363
  31. data/spec/primer/bus_spec.rbc +0 -940
  32. data/spec/primer/cache_spec.rbc +0 -8535
  33. data/spec/primer/helpers/erb_spec.rbc +0 -2485
  34. data/spec/primer/lazyness_spec.rbc +0 -1408
  35. data/spec/primer/watcher/active_record_spec.rbc +0 -5202
  36. data/spec/primer/watcher_spec.rbc +0 -2645
  37. data/spec/schema.rbc +0 -775
  38. data/spec/spec_helper.rbc +0 -1193
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.2.1 / 2011-07-20
2
+
3
+ * Fix in a bug in code that loads associated ActiveRecord classes
4
+
5
+
1
6
  === 0.2.0 / 2011-07-14
2
7
 
3
8
  * New Lazyness module to avoid ActiveRecord database calls when not needed
Binary file
@@ -45,7 +45,7 @@ module Primer
45
45
 
46
46
  def notify_belongs_to_association(model, assoc_name, change = nil)
47
47
  assoc = model.class.reflect_on_association(assoc_name)
48
- owner_class = assoc.class_name.constantize
48
+ owner_class = assoc.klass
49
49
 
50
50
  mirror = mirror_association(model.class, owner_class, :has_many)
51
51
 
@@ -69,8 +69,7 @@ module Primer
69
69
  next if assoc.options[:dependent] == :destroy
70
70
 
71
71
  model_id = model.__send__(model.class.primary_key)
72
- klass = assoc.class_name.constantize
73
- related = klass.find(:all, :conditions => {assoc.primary_key_name => model_id})
72
+ related = assoc.klass.find(:all, :conditions => {assoc.primary_key_name => model_id})
74
73
 
75
74
  related.each do |object|
76
75
  mirror = mirror_association(model.class, object.class, :belongs_to)
@@ -89,7 +88,7 @@ module Primer
89
88
  Primer.bus.publish(:changes, model.primer_identifier + [assoc.name.to_s])
90
89
  end
91
90
 
92
- assoc.class_name.constantize.reflect_on_all_associations.each do |secondary|
91
+ assoc.klass.reflect_on_all_associations.each do |secondary|
93
92
  next unless secondary.macro == :has_many and secondary.options[:through] and
94
93
  secondary.source_reflection.active_record == model.class and
95
94
  secondary.source_reflection.name == through_name
data/spec/db/test.sqlite3 CHANGED
Binary file
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: primer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Coglan
@@ -10,7 +10,8 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-16 00:00:00 Z
13
+ date: 2011-07-20 00:00:00 +01:00
14
+ default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: redis
@@ -123,91 +124,59 @@ extra_rdoc_files:
123
124
  files:
124
125
  - History.txt
125
126
  - README.rdoc
127
+ - spec/spec_helper.rb
126
128
  - spec/db/test.sqlite3
129
+ - spec/templates/page.erb
130
+ - spec/primer/watcher_spec.rb
131
+ - spec/primer/bus_spec.rb
132
+ - spec/primer/helpers/erb_spec.rb
133
+ - spec/primer/watcher/active_record_spec.rb
134
+ - spec/primer/lazyness_spec.rb
135
+ - spec/primer/cache_spec.rb
136
+ - spec/models/watchable.rb
137
+ - spec/models/person.rb
127
138
  - spec/models/artist.rb
128
- - spec/models/artist.rbc
129
- - spec/models/blog_post.rb
130
- - spec/models/blog_post.rbc
131
139
  - spec/models/calendar.rb
132
- - spec/models/calendar.rbc
133
140
  - spec/models/concert.rb
134
- - spec/models/concert.rbc
141
+ - spec/models/blog_post.rb
135
142
  - spec/models/performance.rb
136
- - spec/models/performance.rbc
137
- - spec/models/person.rb
138
- - spec/models/person.rbc
139
- - spec/models/watchable.rb
140
- - spec/models/watchable.rbc
141
- - spec/primer/bus_spec.rb
142
- - spec/primer/bus_spec.rbc
143
- - spec/primer/cache_spec.rb
144
- - spec/primer/cache_spec.rbc
145
- - spec/primer/helpers/erb_spec.rb
146
- - spec/primer/helpers/erb_spec.rbc
147
- - spec/primer/lazyness_spec.rb
148
- - spec/primer/lazyness_spec.rbc
149
- - spec/primer/watcher/active_record_spec.rb
150
- - spec/primer/watcher/active_record_spec.rbc
151
- - spec/primer/watcher_spec.rb
152
- - spec/primer/watcher_spec.rbc
153
143
  - spec/schema.rb
154
- - spec/schema.rbc
155
- - spec/spec_helper.rb
156
- - spec/spec_helper.rbc
157
- - spec/templates/page.erb
158
- - lib/javascript/primer.js
144
+ - lib/primer.rb
145
+ - lib/primer/watcher.rb
146
+ - lib/primer/lazyness.rb
159
147
  - lib/primer/bus/amqp.rb
160
- - lib/primer/bus/amqp.rbc
161
148
  - lib/primer/bus/memory.rb
162
- - lib/primer/bus/memory.rbc
163
- - lib/primer/bus.rb
164
- - lib/primer/bus.rbc
165
- - lib/primer/cache/memory.rb
166
- - lib/primer/cache/memory.rbc
167
- - lib/primer/cache/redis.rb
168
- - lib/primer/cache/redis.rbc
169
149
  - lib/primer/cache.rb
170
- - lib/primer/cache.rbc
150
+ - lib/primer/worker.rb
151
+ - lib/primer/watcher/macros.rb
152
+ - lib/primer/watcher/active_record_macros.rb
171
153
  - lib/primer/enabler.rb
172
- - lib/primer/enabler.rbc
173
- - lib/primer/helpers.rb
174
- - lib/primer/helpers.rbc
175
- - lib/primer/lazyness.rb
176
- - lib/primer/lazyness.rbc
154
+ - lib/primer/cache/redis.rb
155
+ - lib/primer/cache/memory.rb
177
156
  - lib/primer/real_time.rb
178
- - lib/primer/real_time.rbc
179
- - lib/primer/route_set.rb
180
- - lib/primer/route_set.rbc
181
- - lib/primer/watcher/active_record_macros.rb
182
- - lib/primer/watcher/active_record_macros.rbc
183
- - lib/primer/watcher/macros.rb
184
- - lib/primer/watcher/macros.rbc
185
- - lib/primer/watcher.rb
186
- - lib/primer/watcher.rbc
187
- - lib/primer/worker/active_record_agent.rb
188
- - lib/primer/worker/active_record_agent.rbc
157
+ - lib/primer/helpers.rb
158
+ - lib/primer/bus.rb
189
159
  - lib/primer/worker/changes_agent.rb
190
- - lib/primer/worker/changes_agent.rbc
191
- - lib/primer/worker.rb
192
- - lib/primer/worker.rbc
193
- - lib/primer.rb
194
- - lib/primer.rbc
160
+ - lib/primer/worker/active_record_agent.rb
161
+ - lib/primer/route_set.rb
162
+ - lib/javascript/primer.js
195
163
  - example/application.rb
196
- - example/config.ru
197
- - example/console.rb
164
+ - example/environment.rb
198
165
  - example/db/blog.sqlite3
199
166
  - example/db/connection.rb
200
- - example/environment.rb
201
- - example/models/comment.rb
202
- - example/models/post.rb
203
- - example/public/style.css
204
- - example/README.rdoc
205
- - example/script/setup_database.rb
167
+ - example/console.rb
206
168
  - example/views/comments.erb
207
169
  - example/views/index.erb
208
170
  - example/views/layout.erb
209
171
  - example/views/show.erb
172
+ - example/script/setup_database.rb
173
+ - example/public/style.css
210
174
  - example/worker.rb
175
+ - example/README.rdoc
176
+ - example/models/comment.rb
177
+ - example/models/post.rb
178
+ - example/config.ru
179
+ has_rdoc: true
211
180
  homepage: http://github.com/jcoglan/primer
212
181
  licenses: []
213
182
 
@@ -234,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
203
  requirements: []
235
204
 
236
205
  rubyforge_project:
237
- rubygems_version: 1.8.5
206
+ rubygems_version: 1.6.2
238
207
  signing_key:
239
208
  specification_version: 3
240
209
  summary: Intelligent caching, no observers necessary