active_scaffold_sortable 3.3.7 → 3.3.10
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d70b6e4f025e689fb53925722bb1deda409627cbdcede20161190c3ca10b76b9
|
4
|
+
data.tar.gz: 81885ddbf593c12ad5961b22a7a0058a6afdc4c02486fc5125ca582f3181fe51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e6230b9887d5541c296736408abad598dedf220ab60364a59e2d0ca40e7faee04bb159758f32939adcfaea03d7f710917e94774baface663f453833a3115fa5
|
7
|
+
data.tar.gz: 425dc8d853fcd44e17a3d4fce9a4b4e0a83f5da637d7013e23eb9b386133175b3b1d41efa2a16319c2ae6df938015c67e690317ccad2bb4e28556bf1854c06b4
|
@@ -24,14 +24,12 @@ module ActiveScaffold::Actions
|
|
24
24
|
def reorder
|
25
25
|
model = active_scaffold_config.model
|
26
26
|
|
27
|
-
|
27
|
+
if (model.instance_methods & [:nested_set_scope, 'nested_set_scope']).present?
|
28
28
|
reorder_children_in_tree(model)
|
29
|
+
elsif model.respond_to? :ancestry_column
|
30
|
+
reorder_ancestry_tree(model)
|
29
31
|
else
|
30
|
-
|
31
|
-
reorder_ancestry_tree(model)
|
32
|
-
else
|
33
|
-
reorder_simple_list(model)
|
34
|
-
end
|
32
|
+
reorder_simple_list(model)
|
35
33
|
end
|
36
34
|
do_refresh_list if active_scaffold_config.sortable.refresh_list
|
37
35
|
end
|
@@ -52,9 +50,11 @@ module ActiveScaffold::Actions
|
|
52
50
|
end
|
53
51
|
|
54
52
|
def reorder_simple_list(model)
|
53
|
+
updates = ActiveScaffold::OrmChecks.columns_hash(model)['updated_at'] ? {updated_at: Time.now} : {}
|
55
54
|
column_name = active_scaffold_config.sortable.column.name
|
56
55
|
ordered_ids.each.with_index do |id, index|
|
57
|
-
|
56
|
+
updates[column_name] = index + 1
|
57
|
+
model.where(model.primary_key => id).update_all(updates)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ActiveScaffold::Config
|
2
2
|
class Sortable < Base
|
3
3
|
def initialize(core_config)
|
4
|
-
|
4
|
+
super
|
5
5
|
@options = self.class.options.clone
|
6
6
|
|
7
7
|
self.column = core_config.model.new.position_column unless (@core.model.instance_methods & [:acts_as_list_class, 'acts_as_list_class']).empty?
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold_sortable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Cambra
|
8
8
|
- Volker Hochstein
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active_scaffold
|
@@ -70,7 +70,7 @@ homepage: http://github.com/activescaffold/active_scaffold_sortable
|
|
70
70
|
licenses:
|
71
71
|
- MIT
|
72
72
|
metadata: {}
|
73
|
-
post_install_message:
|
73
|
+
post_install_message:
|
74
74
|
rdoc_options: []
|
75
75
|
require_paths:
|
76
76
|
- lib
|
@@ -85,9 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
|
-
|
89
|
-
|
90
|
-
signing_key:
|
88
|
+
rubygems_version: 3.3.7
|
89
|
+
signing_key:
|
91
90
|
specification_version: 4
|
92
91
|
summary: Drag n Drop Sorting for Activescaffold
|
93
92
|
test_files:
|