effective_mergery 0.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/app/assets/stylesheets/effective_mergery/_merge.scss +19 -0
- data/app/controllers/admin/merge_controller.rb +13 -0
- data/app/models/effective/merge.rb +5 -1
- data/app/views/admin/merge/_attributes.html.haml +2 -2
- data/app/views/admin/merge/new.html.haml +4 -4
- data/lib/effective_mergery/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4e751ae3a297a246234ca3ff72a6b62bc14155b3bbd6b7c0f9eeaba5b9796af7
|
4
|
+
data.tar.gz: 17d6fbd0a636ceced68cb8fa8ecf75fb065dc6cf852179261cf048188027eb1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45508ec13104cf058e23c0cab87e13c5dd1bf0a51819fbb0e56fde7f2d3cd096ba70b57b0bf754f338ce4b98888f9ee51c08b71a2a454957885e14fb2a307539
|
7
|
+
data.tar.gz: cc61256a1aeb2966098293b2b646ec4e993aeb0fa45fa1ff9a377216916bbbf42fb4b959307ffb7a3c4dbd578133777d6b4bbe9a344a71c7adb0506a15dcb6e2
|
@@ -3,3 +3,22 @@
|
|
3
3
|
.table-attributes { opacity: 0.4; }
|
4
4
|
}
|
5
5
|
}
|
6
|
+
|
7
|
+
.table-merge.table > thead > tr > th,
|
8
|
+
.table-merge.table > thead > tr > td,
|
9
|
+
.table-merge.table > tbody > tr > th,
|
10
|
+
.table-merge.table > tbody > tr > td,
|
11
|
+
.table-merge.table > tfoot > tr > th,
|
12
|
+
.table-merge.table > tfoot > tr > td {
|
13
|
+
padding: 0 5px 5px 5px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.effective-merge {
|
17
|
+
.encrypted_password,
|
18
|
+
.reset_password_token,
|
19
|
+
.confirmation_token,
|
20
|
+
.unique_session_id,
|
21
|
+
.invitation_token {
|
22
|
+
display: none;
|
23
|
+
}
|
24
|
+
}
|
@@ -31,6 +31,19 @@ module Admin
|
|
31
31
|
@page_title = 'Successful Merge'
|
32
32
|
flash[:success] = "Successfully merged #{@merge}"
|
33
33
|
|
34
|
+
if defined?(EffectiveLogging)
|
35
|
+
EffectiveLogger.success(
|
36
|
+
"Merged #{@merge} - #{@merge.source.respond_to?(:to_s_verbose) ? @merge.source.to_s_verbose : @merge.source.to_s}",
|
37
|
+
user: (current_user rescue false),
|
38
|
+
associated: @merge.target,
|
39
|
+
source_id: @merge.source_id,
|
40
|
+
target_id: @merge.target_id,
|
41
|
+
mergable_type: @merge.type,
|
42
|
+
source_email: (@merge.source.email if @merge.source.respond_to?(:email)),
|
43
|
+
source_name: (@merge.source.full_name if @merge.source.respond_to?(:full_name))
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
34
47
|
@merge.target = @merge.collection.find(@merge.target_id)
|
35
48
|
else
|
36
49
|
@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
|
@@ -1,3 +1,3 @@
|
|
1
|
-
= tableize_hash(resource.attributes, table: 'table table-attributes')
|
1
|
+
= tableize_hash(resource.attributes, table: 'table table-merge table-attributes')
|
2
2
|
%hr
|
3
|
-
= tableize_hash(Effective::Resource.new(resource).instance_attributes.except(:attributes))
|
3
|
+
= tableize_hash(Effective::Resource.new(resource).instance_attributes.except(:attributes), table: 'table table-merge', sub_table: 'table table-merge table-subtable')
|
@@ -3,17 +3,17 @@
|
|
3
3
|
%p Please select a source and target. The source record's associated data, but not its attributes, will be merged into the target. The source record will then be destroyed.
|
4
4
|
|
5
5
|
.effective-merge
|
6
|
-
= simple_form_for
|
6
|
+
= simple_form_for([:admin, @merge], url: effective_mergery.admin_merge_index_path) do |f|
|
7
7
|
= f.input :type, as: :hidden
|
8
8
|
|
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
|
@@ -25,5 +25,5 @@
|
|
25
25
|
- if f.object.target.present?
|
26
26
|
= render partial: '/admin/merge/attributes', locals: { resource: f.object.target }
|
27
27
|
|
28
|
-
.
|
28
|
+
.form-actions
|
29
29
|
= f.button :submit, "Merge #{@merge}", data: { disable_with: 'Merging...', confirm: "Really merge? The source record will be destroyed."}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_mergery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -110,7 +110,7 @@ homepage: https://github.com/code-and-effect/effective_mergery
|
|
110
110
|
licenses:
|
111
111
|
- MIT
|
112
112
|
metadata: {}
|
113
|
-
post_install_message:
|
113
|
+
post_install_message:
|
114
114
|
rdoc_options: []
|
115
115
|
require_paths:
|
116
116
|
- lib
|
@@ -125,9 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
|
129
|
-
|
130
|
-
signing_key:
|
128
|
+
rubygems_version: 3.1.2
|
129
|
+
signing_key:
|
131
130
|
specification_version: 4
|
132
131
|
summary: Deep merge any two Active Record objects.
|
133
132
|
test_files: []
|