effective_mergery 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7922291a6535bd2af2889d85cac2efbc752e91e4
|
4
|
+
data.tar.gz: 336c05b1877392c6a80745c6babcb2a1904eef21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b505d67ebe8cc3c508c0866b788e558c9465fa77138823ea64758cef0cc8ec1b39772b25b902790651cf9016685949505c41285d378594a68fdb3b4cbb1d7d78
|
7
|
+
data.tar.gz: d3fbb1258801e743d1dec0d3ff9a431c3372ef76db7170e1c3eb9660f12b1f3a1a3004f4a7db57a546a54d51530a2ff1637d9c69acbdc1fdd03c228ea7d8719f
|
@@ -31,6 +31,10 @@ module Admin
|
|
31
31
|
@page_title = 'Successful Merge'
|
32
32
|
flash[:success] = "Successfully merged #{@merge}"
|
33
33
|
|
34
|
+
if defined?(EffectiveLogging)
|
35
|
+
EffectiveLogger.success "Merged #{@merge}", user: (current_user rescue false), associated: @merge.target, source_id: @merge.source_id, target_id: @merge.target_id, mergable_type: @merge.type
|
36
|
+
end
|
37
|
+
|
34
38
|
@merge.target = @merge.collection.find(@merge.target_id)
|
35
39
|
else
|
36
40
|
@page_title = 'New Merge'
|
@@ -34,7 +34,11 @@ module Effective
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def collection
|
37
|
-
@collection ||= (klass.respond_to?(:
|
37
|
+
@collection ||= (klass.respond_to?(:effective_mergery_collection) ? klass.effective_mergery_collection : klass.all)
|
38
|
+
end
|
39
|
+
|
40
|
+
def form_collection
|
41
|
+
@form_collection ||= (klass.respond_to?(:effective_mergery_form_collection) ? klass.effective_mergery_form_collection : collection)
|
38
42
|
end
|
39
43
|
|
40
44
|
def klass
|
@@ -9,11 +9,11 @@
|
|
9
9
|
.row
|
10
10
|
.col-sm-6
|
11
11
|
= f.input :source_id, as: (defined?(EffectiveFormInputs) ? :effective_select : :select),
|
12
|
-
collection: f.object.
|
12
|
+
collection: f.object.form_collection,
|
13
13
|
hint: 'This record will be destroyed'
|
14
14
|
.col-sm-6
|
15
15
|
= f.input :target_id, as: (defined?(EffectiveFormInputs) ? :effective_select : :select),
|
16
|
-
collection: f.object.
|
16
|
+
collection: f.object.form_collection,
|
17
17
|
hint: 'This record will be kept'
|
18
18
|
|
19
19
|
.row
|