rails-observers 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +11 -0
- data/LICENSE +22 -0
- data/README.md +102 -0
- data/Rakefile +34 -0
- data/lib/generators/active_record/observer/observer_generator.rb +17 -0
- data/lib/generators/active_record/observer/templates/observer.rb +4 -0
- data/lib/generators/rails/observer/USAGE +12 -0
- data/lib/generators/rails/observer/observer_generator.rb +7 -0
- data/lib/generators/test_unit/observer/observer_generator.rb +15 -0
- data/lib/generators/test_unit/observer/templates/unit_test.rb +9 -0
- data/lib/rails-observers.rb +30 -0
- data/lib/rails/observers/action_controller/caching.rb +12 -0
- data/lib/rails/observers/action_controller/caching/sweeping.rb +113 -0
- data/lib/rails/observers/active_model/active_model.rb +4 -0
- data/lib/rails/observers/active_model/observer_array.rb +152 -0
- data/lib/rails/observers/active_model/observing.rb +374 -0
- data/lib/rails/observers/activerecord/active_record.rb +5 -0
- data/lib/rails/observers/activerecord/base.rb +8 -0
- data/lib/rails/observers/activerecord/observer.rb +125 -0
- data/lib/rails/observers/version.rb +5 -0
- data/rails-observers.gemspec +26 -0
- data/test/configuration_test.rb +37 -0
- data/test/console_test.rb +38 -0
- data/test/fixtures/developers.yml +4 -0
- data/test/fixtures/minimalistics.yml +2 -0
- data/test/fixtures/topics.yml +41 -0
- data/test/generators/generators_test_helper.rb +16 -0
- data/test/generators/namespaced_generators_test.rb +34 -0
- data/test/generators/observer_generator_test.rb +33 -0
- data/test/helper.rb +74 -0
- data/test/isolation/abstract_unit.rb +108 -0
- data/test/lifecycle_test.rb +249 -0
- data/test/models/observers.rb +27 -0
- data/test/observer_array_test.rb +222 -0
- data/test/observing_test.rb +183 -0
- data/test/rake_test.rb +40 -0
- data/test/sweeper_test.rb +83 -0
- data/test/transaction_callbacks_test.rb +278 -0
- metadata +216 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'action_controller'
|
3
|
+
require 'active_record'
|
4
|
+
require 'rails/observers/activerecord/active_record'
|
5
|
+
require 'rails/observers/action_controller/caching'
|
6
|
+
|
7
|
+
SharedTestRoutes = ActionDispatch::Routing::RouteSet.new
|
8
|
+
|
9
|
+
class AppSweeper < ActionController::Caching::Sweeper; end
|
10
|
+
|
11
|
+
class SweeperTestController < ActionController::Base
|
12
|
+
include SharedTestRoutes.url_helpers
|
13
|
+
|
14
|
+
cache_sweeper :app_sweeper
|
15
|
+
|
16
|
+
def show
|
17
|
+
render text: 'hello world'
|
18
|
+
end
|
19
|
+
|
20
|
+
def error
|
21
|
+
raise StandardError.new
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class SweeperTest < ActionController::TestCase
|
26
|
+
def setup
|
27
|
+
@routes = SharedTestRoutes
|
28
|
+
|
29
|
+
@routes.draw do
|
30
|
+
get ':controller(/:action)'
|
31
|
+
end
|
32
|
+
|
33
|
+
super
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_sweeper_should_not_ignore_no_method_error
|
37
|
+
sweeper = ActionController::Caching::Sweeper.send(:new)
|
38
|
+
assert_raise NoMethodError do
|
39
|
+
sweeper.send_not_defined
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_sweeper_should_not_block_rendering
|
44
|
+
response = test_process(SweeperTestController)
|
45
|
+
assert_equal 'hello world', response.body
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_sweeper_should_clean_up_if_exception_is_raised
|
49
|
+
assert_raise StandardError do
|
50
|
+
test_process(SweeperTestController, 'error')
|
51
|
+
end
|
52
|
+
assert_nil AppSweeper.instance.controller
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_before_method_of_sweeper_should_always_return_true
|
56
|
+
sweeper = ActionController::Caching::Sweeper.send(:new)
|
57
|
+
assert sweeper.before(SweeperTestController.new)
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_after_method_of_sweeper_should_always_return_nil
|
61
|
+
sweeper = ActionController::Caching::Sweeper.send(:new)
|
62
|
+
assert_nil sweeper.after(SweeperTestController.new)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_sweeper_should_not_ignore_unknown_method_calls
|
66
|
+
sweeper = ActionController::Caching::Sweeper.send(:new)
|
67
|
+
assert_raise NameError do
|
68
|
+
sweeper.instance_eval do
|
69
|
+
some_method_that_doesnt_exist
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
def test_process(controller, action = "show")
|
77
|
+
@controller = controller.is_a?(Class) ? controller.new : controller
|
78
|
+
@request = ActionController::TestRequest.new
|
79
|
+
@response = ActionController::TestResponse.new
|
80
|
+
|
81
|
+
process(action)
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,278 @@
|
|
1
|
+
require "helper"
|
2
|
+
|
3
|
+
class TransactionCallbacksTest < ActiveRecord::TestCase
|
4
|
+
self.use_transactional_fixtures = false
|
5
|
+
fixtures :topics
|
6
|
+
|
7
|
+
class TopicWithCallbacks < ActiveRecord::Base
|
8
|
+
self.table_name = :topics
|
9
|
+
|
10
|
+
after_commit{|record| record.send(:do_after_commit, nil)}
|
11
|
+
after_commit(:on => :create){|record| record.send(:do_after_commit, :create)}
|
12
|
+
after_commit(:on => :update){|record| record.send(:do_after_commit, :update)}
|
13
|
+
after_commit(:on => :destroy){|record| record.send(:do_after_commit, :destroy)}
|
14
|
+
after_rollback{|record| record.send(:do_after_rollback, nil)}
|
15
|
+
after_rollback(:on => :create){|record| record.send(:do_after_rollback, :create)}
|
16
|
+
after_rollback(:on => :update){|record| record.send(:do_after_rollback, :update)}
|
17
|
+
after_rollback(:on => :destroy){|record| record.send(:do_after_rollback, :destroy)}
|
18
|
+
|
19
|
+
def history
|
20
|
+
@history ||= []
|
21
|
+
end
|
22
|
+
|
23
|
+
def after_commit_block(on = nil, &block)
|
24
|
+
@after_commit ||= {}
|
25
|
+
@after_commit[on] ||= []
|
26
|
+
@after_commit[on] << block
|
27
|
+
end
|
28
|
+
|
29
|
+
def after_rollback_block(on = nil, &block)
|
30
|
+
@after_rollback ||= {}
|
31
|
+
@after_rollback[on] ||= []
|
32
|
+
@after_rollback[on] << block
|
33
|
+
end
|
34
|
+
|
35
|
+
def do_after_commit(on)
|
36
|
+
blocks = @after_commit[on] if defined?(@after_commit)
|
37
|
+
blocks.each{|b| b.call(self)} if blocks
|
38
|
+
end
|
39
|
+
|
40
|
+
def do_after_rollback(on)
|
41
|
+
blocks = @after_rollback[on] if defined?(@after_rollback)
|
42
|
+
blocks.each{|b| b.call(self)} if blocks
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def setup
|
47
|
+
@first, @second = TopicWithCallbacks.find(1, 3).sort_by { |t| t.id }
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_call_after_commit_after_transaction_commits
|
51
|
+
@first.after_commit_block{|r| r.history << :after_commit}
|
52
|
+
@first.after_rollback_block{|r| r.history << :after_rollback}
|
53
|
+
|
54
|
+
@first.save!
|
55
|
+
assert_equal [:after_commit], @first.history
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_only_call_after_commit_on_update_after_transaction_commits_for_existing_record
|
59
|
+
@first.after_commit_block(:create){|r| r.history << :commit_on_create}
|
60
|
+
@first.after_commit_block(:update){|r| r.history << :commit_on_update}
|
61
|
+
@first.after_commit_block(:destroy){|r| r.history << :commit_on_destroy}
|
62
|
+
@first.after_rollback_block(:create){|r| r.history << :rollback_on_create}
|
63
|
+
@first.after_rollback_block(:update){|r| r.history << :rollback_on_update}
|
64
|
+
@first.after_rollback_block(:destroy){|r| r.history << :rollback_on_destroy}
|
65
|
+
|
66
|
+
@first.save!
|
67
|
+
assert_equal [:commit_on_update], @first.history
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_only_call_after_commit_on_destroy_after_transaction_commits_for_destroyed_record
|
71
|
+
@first.after_commit_block(:create){|r| r.history << :commit_on_create}
|
72
|
+
@first.after_commit_block(:update){|r| r.history << :commit_on_update}
|
73
|
+
@first.after_commit_block(:destroy){|r| r.history << :commit_on_destroy}
|
74
|
+
@first.after_rollback_block(:create){|r| r.history << :rollback_on_create}
|
75
|
+
@first.after_rollback_block(:update){|r| r.history << :rollback_on_update}
|
76
|
+
@first.after_rollback_block(:destroy){|r| r.history << :rollback_on_destroy}
|
77
|
+
|
78
|
+
@first.destroy
|
79
|
+
assert_equal [:commit_on_destroy], @first.history
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_only_call_after_commit_on_create_after_transaction_commits_for_new_record
|
83
|
+
@new_record = TopicWithCallbacks.new(:title => "New topic", :written_on => Date.today)
|
84
|
+
@new_record.after_commit_block(:create){|r| r.history << :commit_on_create}
|
85
|
+
@new_record.after_commit_block(:update){|r| r.history << :commit_on_update}
|
86
|
+
@new_record.after_commit_block(:destroy){|r| r.history << :commit_on_destroy}
|
87
|
+
@new_record.after_rollback_block(:create){|r| r.history << :rollback_on_create}
|
88
|
+
@new_record.after_rollback_block(:update){|r| r.history << :rollback_on_update}
|
89
|
+
@new_record.after_rollback_block(:destroy){|r| r.history << :rollback_on_destroy}
|
90
|
+
|
91
|
+
@new_record.save!
|
92
|
+
assert_equal [:commit_on_create], @new_record.history
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_call_after_rollback_after_transaction_rollsback
|
96
|
+
@first.after_commit_block{|r| r.history << :after_commit}
|
97
|
+
@first.after_rollback_block{|r| r.history << :after_rollback}
|
98
|
+
|
99
|
+
Topic.transaction do
|
100
|
+
@first.save!
|
101
|
+
raise ActiveRecord::Rollback
|
102
|
+
end
|
103
|
+
|
104
|
+
assert_equal [:after_rollback], @first.history
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_only_call_after_rollback_on_update_after_transaction_rollsback_for_existing_record
|
108
|
+
@first.after_commit_block(:create){|r| r.history << :commit_on_create}
|
109
|
+
@first.after_commit_block(:update){|r| r.history << :commit_on_update}
|
110
|
+
@first.after_commit_block(:destroy){|r| r.history << :commit_on_destroy}
|
111
|
+
@first.after_rollback_block(:create){|r| r.history << :rollback_on_create}
|
112
|
+
@first.after_rollback_block(:update){|r| r.history << :rollback_on_update}
|
113
|
+
@first.after_rollback_block(:destroy){|r| r.history << :rollback_on_destroy}
|
114
|
+
|
115
|
+
Topic.transaction do
|
116
|
+
@first.save!
|
117
|
+
raise ActiveRecord::Rollback
|
118
|
+
end
|
119
|
+
|
120
|
+
assert_equal [:rollback_on_update], @first.history
|
121
|
+
end
|
122
|
+
|
123
|
+
def test_only_call_after_rollback_on_destroy_after_transaction_rollsback_for_destroyed_record
|
124
|
+
@first.after_commit_block(:create){|r| r.history << :commit_on_create}
|
125
|
+
@first.after_commit_block(:update){|r| r.history << :commit_on_update}
|
126
|
+
@first.after_commit_block(:destroy){|r| r.history << :commit_on_update}
|
127
|
+
@first.after_rollback_block(:create){|r| r.history << :rollback_on_create}
|
128
|
+
@first.after_rollback_block(:update){|r| r.history << :rollback_on_update}
|
129
|
+
@first.after_rollback_block(:destroy){|r| r.history << :rollback_on_destroy}
|
130
|
+
|
131
|
+
Topic.transaction do
|
132
|
+
@first.destroy
|
133
|
+
raise ActiveRecord::Rollback
|
134
|
+
end
|
135
|
+
|
136
|
+
assert_equal [:rollback_on_destroy], @first.history
|
137
|
+
end
|
138
|
+
|
139
|
+
def test_only_call_after_rollback_on_create_after_transaction_rollsback_for_new_record
|
140
|
+
@new_record = TopicWithCallbacks.new(:title => "New topic", :written_on => Date.today)
|
141
|
+
@new_record.after_commit_block(:create){|r| r.history << :commit_on_create}
|
142
|
+
@new_record.after_commit_block(:update){|r| r.history << :commit_on_update}
|
143
|
+
@new_record.after_commit_block(:destroy){|r| r.history << :commit_on_destroy}
|
144
|
+
@new_record.after_rollback_block(:create){|r| r.history << :rollback_on_create}
|
145
|
+
@new_record.after_rollback_block(:update){|r| r.history << :rollback_on_update}
|
146
|
+
@new_record.after_rollback_block(:destroy){|r| r.history << :rollback_on_destroy}
|
147
|
+
|
148
|
+
Topic.transaction do
|
149
|
+
@new_record.save!
|
150
|
+
raise ActiveRecord::Rollback
|
151
|
+
end
|
152
|
+
|
153
|
+
assert_equal [:rollback_on_create], @new_record.history
|
154
|
+
end
|
155
|
+
|
156
|
+
def test_call_after_rollback_when_commit_fails
|
157
|
+
@first.connection.class.send(:alias_method, :real_method_commit_db_transaction, :commit_db_transaction)
|
158
|
+
begin
|
159
|
+
@first.connection.class.class_eval do
|
160
|
+
def commit_db_transaction; raise "boom!"; end
|
161
|
+
end
|
162
|
+
|
163
|
+
@first.after_commit_block{|r| r.history << :after_commit}
|
164
|
+
@first.after_rollback_block{|r| r.history << :after_rollback}
|
165
|
+
|
166
|
+
assert !@first.save rescue nil
|
167
|
+
assert_equal [:after_rollback], @first.history
|
168
|
+
ensure
|
169
|
+
@first.connection.class.send(:remove_method, :commit_db_transaction)
|
170
|
+
@first.connection.class.send(:alias_method, :commit_db_transaction, :real_method_commit_db_transaction)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
def test_only_call_after_rollback_on_records_rolled_back_to_a_savepoint
|
175
|
+
def @first.rollbacks(i=0); @rollbacks ||= 0; @rollbacks += i if i; end
|
176
|
+
def @first.commits(i=0); @commits ||= 0; @commits += i if i; end
|
177
|
+
@first.after_rollback_block{|r| r.rollbacks(1)}
|
178
|
+
@first.after_commit_block{|r| r.commits(1)}
|
179
|
+
|
180
|
+
def @second.rollbacks(i=0); @rollbacks ||= 0; @rollbacks += i if i; end
|
181
|
+
def @second.commits(i=0); @commits ||= 0; @commits += i if i; end
|
182
|
+
@second.after_rollback_block{|r| r.rollbacks(1)}
|
183
|
+
@second.after_commit_block{|r| r.commits(1)}
|
184
|
+
|
185
|
+
Topic.transaction do
|
186
|
+
@first.save!
|
187
|
+
Topic.transaction(:requires_new => true) do
|
188
|
+
@second.save!
|
189
|
+
raise ActiveRecord::Rollback
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
assert_equal 1, @first.commits
|
194
|
+
assert_equal 0, @first.rollbacks
|
195
|
+
assert_equal 0, @second.commits
|
196
|
+
assert_equal 1, @second.rollbacks
|
197
|
+
end
|
198
|
+
|
199
|
+
def test_only_call_after_rollback_on_records_rolled_back_to_a_savepoint_when_release_savepoint_fails
|
200
|
+
def @first.rollbacks(i=0); @rollbacks ||= 0; @rollbacks += i if i; end
|
201
|
+
def @first.commits(i=0); @commits ||= 0; @commits += i if i; end
|
202
|
+
|
203
|
+
@first.after_rollback_block{|r| r.rollbacks(1)}
|
204
|
+
@first.after_commit_block{|r| r.commits(1)}
|
205
|
+
|
206
|
+
Topic.transaction do
|
207
|
+
@first.save
|
208
|
+
Topic.transaction(:requires_new => true) do
|
209
|
+
@first.save!
|
210
|
+
raise ActiveRecord::Rollback
|
211
|
+
end
|
212
|
+
Topic.transaction(:requires_new => true) do
|
213
|
+
@first.save!
|
214
|
+
raise ActiveRecord::Rollback
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
assert_equal 1, @first.commits
|
219
|
+
assert_equal 2, @first.rollbacks
|
220
|
+
end
|
221
|
+
|
222
|
+
def test_after_transaction_callbacks_should_prevent_callbacks_from_being_called
|
223
|
+
def @first.last_after_transaction_error=(e); @last_transaction_error = e; end
|
224
|
+
def @first.last_after_transaction_error; @last_transaction_error; end
|
225
|
+
@first.after_commit_block{|r| r.last_after_transaction_error = :commit; raise "fail!";}
|
226
|
+
@first.after_rollback_block{|r| r.last_after_transaction_error = :rollback; raise "fail!";}
|
227
|
+
@second.after_commit_block{|r| r.history << :after_commit}
|
228
|
+
@second.after_rollback_block{|r| r.history << :after_rollback}
|
229
|
+
|
230
|
+
Topic.transaction do
|
231
|
+
@first.save!
|
232
|
+
@second.save!
|
233
|
+
end
|
234
|
+
assert_equal :commit, @first.last_after_transaction_error
|
235
|
+
assert_equal [:after_commit], @second.history
|
236
|
+
|
237
|
+
@second.history.clear
|
238
|
+
Topic.transaction do
|
239
|
+
@first.save!
|
240
|
+
@second.save!
|
241
|
+
raise ActiveRecord::Rollback
|
242
|
+
end
|
243
|
+
assert_equal :rollback, @first.last_after_transaction_error
|
244
|
+
assert_equal [:after_rollback], @second.history
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
|
249
|
+
class SaveFromAfterCommitBlockTest < ActiveRecord::TestCase
|
250
|
+
self.use_transactional_fixtures = false
|
251
|
+
|
252
|
+
class TopicWithSaveInCallback < ActiveRecord::Base
|
253
|
+
self.table_name = :topics
|
254
|
+
after_commit :cache_topic, :on => :create
|
255
|
+
after_commit :call_update, :on => :update
|
256
|
+
attr_accessor :cached, :record_updated
|
257
|
+
|
258
|
+
def call_update
|
259
|
+
self.record_updated = true
|
260
|
+
end
|
261
|
+
|
262
|
+
def cache_topic
|
263
|
+
unless cached
|
264
|
+
self.cached = true
|
265
|
+
self.save
|
266
|
+
else
|
267
|
+
self.cached = false
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
def test_after_commit_in_save
|
273
|
+
topic = TopicWithSaveInCallback.new()
|
274
|
+
topic.save
|
275
|
+
assert_equal true, topic.cached
|
276
|
+
assert_equal true, topic.record_updated
|
277
|
+
end
|
278
|
+
end
|
metadata
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails-observers
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Rafael Mendonça França
|
9
|
+
- Steve Klabnik
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-11-28 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: railties
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 4.0.0.beta
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 4.0.0.beta
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: minitest
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '3'
|
39
|
+
type: :development
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '3'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: activerecord
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 4.0.0.beta
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 4.0.0.beta
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: activemodel
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 4.0.0.beta
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ~>
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 4.0.0.beta
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: actionmailer
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 4.0.0.beta
|
87
|
+
type: :development
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 4.0.0.beta
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: actionpack
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ~>
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 4.0.0.beta
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 4.0.0.beta
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: sqlite3
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ~>
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '1.3'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ~>
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '1.3'
|
127
|
+
description: Rails observer (removed from core in Rails 4.0)
|
128
|
+
email:
|
129
|
+
- rafaelmfranca@gmail.com
|
130
|
+
- steve@steveklabnik.com
|
131
|
+
executables: []
|
132
|
+
extensions: []
|
133
|
+
extra_rdoc_files: []
|
134
|
+
files:
|
135
|
+
- .gitignore
|
136
|
+
- Gemfile
|
137
|
+
- LICENSE
|
138
|
+
- README.md
|
139
|
+
- Rakefile
|
140
|
+
- lib/generators/active_record/observer/observer_generator.rb
|
141
|
+
- lib/generators/active_record/observer/templates/observer.rb
|
142
|
+
- lib/generators/rails/observer/USAGE
|
143
|
+
- lib/generators/rails/observer/observer_generator.rb
|
144
|
+
- lib/generators/test_unit/observer/observer_generator.rb
|
145
|
+
- lib/generators/test_unit/observer/templates/unit_test.rb
|
146
|
+
- lib/rails-observers.rb
|
147
|
+
- lib/rails/observers/action_controller/caching.rb
|
148
|
+
- lib/rails/observers/action_controller/caching/sweeping.rb
|
149
|
+
- lib/rails/observers/active_model/active_model.rb
|
150
|
+
- lib/rails/observers/active_model/observer_array.rb
|
151
|
+
- lib/rails/observers/active_model/observing.rb
|
152
|
+
- lib/rails/observers/activerecord/active_record.rb
|
153
|
+
- lib/rails/observers/activerecord/base.rb
|
154
|
+
- lib/rails/observers/activerecord/observer.rb
|
155
|
+
- lib/rails/observers/version.rb
|
156
|
+
- rails-observers.gemspec
|
157
|
+
- test/configuration_test.rb
|
158
|
+
- test/console_test.rb
|
159
|
+
- test/fixtures/developers.yml
|
160
|
+
- test/fixtures/minimalistics.yml
|
161
|
+
- test/fixtures/topics.yml
|
162
|
+
- test/generators/generators_test_helper.rb
|
163
|
+
- test/generators/namespaced_generators_test.rb
|
164
|
+
- test/generators/observer_generator_test.rb
|
165
|
+
- test/helper.rb
|
166
|
+
- test/isolation/abstract_unit.rb
|
167
|
+
- test/lifecycle_test.rb
|
168
|
+
- test/models/observers.rb
|
169
|
+
- test/observer_array_test.rb
|
170
|
+
- test/observing_test.rb
|
171
|
+
- test/rake_test.rb
|
172
|
+
- test/sweeper_test.rb
|
173
|
+
- test/transaction_callbacks_test.rb
|
174
|
+
homepage: https://github.com/rails/rails-observers
|
175
|
+
licenses: []
|
176
|
+
post_install_message:
|
177
|
+
rdoc_options: []
|
178
|
+
require_paths:
|
179
|
+
- lib
|
180
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
181
|
+
none: false
|
182
|
+
requirements:
|
183
|
+
- - ! '>='
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
|
+
none: false
|
188
|
+
requirements:
|
189
|
+
- - ! '>='
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: '0'
|
192
|
+
requirements: []
|
193
|
+
rubyforge_project:
|
194
|
+
rubygems_version: 1.8.23
|
195
|
+
signing_key:
|
196
|
+
specification_version: 3
|
197
|
+
summary: ActiveModel::Observer, ActiveRecord::Observer and ActionController::Caching::Sweeper
|
198
|
+
extracted from Rails.
|
199
|
+
test_files:
|
200
|
+
- test/configuration_test.rb
|
201
|
+
- test/console_test.rb
|
202
|
+
- test/fixtures/developers.yml
|
203
|
+
- test/fixtures/minimalistics.yml
|
204
|
+
- test/fixtures/topics.yml
|
205
|
+
- test/generators/generators_test_helper.rb
|
206
|
+
- test/generators/namespaced_generators_test.rb
|
207
|
+
- test/generators/observer_generator_test.rb
|
208
|
+
- test/helper.rb
|
209
|
+
- test/isolation/abstract_unit.rb
|
210
|
+
- test/lifecycle_test.rb
|
211
|
+
- test/models/observers.rb
|
212
|
+
- test/observer_array_test.rb
|
213
|
+
- test/observing_test.rb
|
214
|
+
- test/rake_test.rb
|
215
|
+
- test/sweeper_test.rb
|
216
|
+
- test/transaction_callbacks_test.rb
|