File tree 2 files changed +12
-12
lines changed
2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 342
342
* Reset @column_defaults when assigning ` locking_column ` .
343
343
We had a potential problem. For example:
344
344
345
- class Post < ActiveRecord::Base
346
- self.column_defaults # if we call this unintentionally before setting locking_column ...
347
- self.locking_column = 'my_locking_column'
348
- end
345
+ class Post < ActiveRecord::Base
346
+ self.column_defaults # if we call this unintentionally before setting locking_column ...
347
+ self.locking_column = 'my_locking_column'
348
+ end
349
349
350
- Post.column_defaults[ "my_locking_column"]
351
- => nil # expected value is 0 !
350
+ Post.column_defaults[ "my_locking_column"]
351
+ => nil # expected value is 0 !
352
352
353
353
* kennyj*
354
354
Original file line number Diff line number Diff line change 22
22
23
23
You can do this:
24
24
25
- class JokeSubscriber < ActiveSupport::Subscriber
26
- # This is much easier to read!
27
- attach_to "active_record"
25
+ class JokeSubscriber < ActiveSupport::Subscriber
26
+ # This is much easier to read!
27
+ attach_to "active_record"
28
28
29
- def sql(event)
30
- puts "A rabbi and a priest walk into a bar..."
29
+ def sql(event)
30
+ puts "A rabbi and a priest walk into a bar..."
31
+ end
31
32
end
32
- end
33
33
34
34
This should make it easier to read and understand these subscribers.
35
35
You can’t perform that action at this time.
0 commit comments