ardm 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ardm/active_record/finalize.rb +5 -4
- data/lib/ardm/version.rb +1 -1
- metadata +1 -1
@@ -3,14 +3,15 @@ module Ardm
|
|
3
3
|
module Finalize
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
def self.on_finalize(&block)
|
7
|
+
@on_finalize ||= []
|
8
|
+
@on_finalize << block if block_given?
|
9
|
+
@on_finalize
|
9
10
|
end
|
10
11
|
|
11
12
|
module ClassMethods
|
12
13
|
def finalize
|
13
|
-
on_finalize.each { |f| f.call }
|
14
|
+
Ardm::ActiveRecord::Finalize.on_finalize.each { |f| f.call }
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
data/lib/ardm/version.rb
CHANGED