active_scaffold_sortable 3.3.8 → 3.3.10

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
  SHA256:
3
- metadata.gz: bd0a221046cbdc19c69cc2c089ef9880034030c1950d61f0ea6fe57a25b1b977
4
- data.tar.gz: 8a151d833254e145a5d57ae6af4b9c3534f250bcaf84bba07a9991f05e43fb38
3
+ metadata.gz: d70b6e4f025e689fb53925722bb1deda409627cbdcede20161190c3ca10b76b9
4
+ data.tar.gz: 81885ddbf593c12ad5961b22a7a0058a6afdc4c02486fc5125ca582f3181fe51
5
5
  SHA512:
6
- metadata.gz: bb046c74e08e3f5c362efa2bce57f575499ee08d86452d39909121acbb4fb89a80217ba7fe686b50dfee6bb7c74a840d7a4422744b6725ca6fdb5c31416ed2a5
7
- data.tar.gz: 7eee82cf921194f5764a0984b9a700c235a8c9f39a4281f983866d592b6c642d68303aba45eddd4ad9216984ede14d9e2156ce2d80f2ecefac015b331c4f44e9
6
+ metadata.gz: 6e6230b9887d5541c296736408abad598dedf220ab60364a59e2d0ca40e7faee04bb159758f32939adcfaea03d7f710917e94774baface663f453833a3115fa5
7
+ data.tar.gz: 425dc8d853fcd44e17a3d4fce9a4b4e0a83f5da637d7013e23eb9b386133175b3b1d41efa2a16319c2ae6df938015c67e690317ccad2bb4e28556bf1854c06b4
@@ -1,5 +1,5 @@
1
1
  <% if active_scaffold_config.sortable.refresh_list %>
2
- <%= render :partial => 'refresh_list' %>
2
+ <%= render 'refresh_list', no_history: true %>
3
3
  <% else %>
4
4
  ActiveScaffold.stripe('<%= active_scaffold_tbody_id %>');
5
5
  <% end %>
@@ -24,14 +24,12 @@ module ActiveScaffold::Actions
24
24
  def reorder
25
25
  model = active_scaffold_config.model
26
26
 
27
- unless (model.instance_methods & [:nested_set_scope, 'nested_set_scope']).empty?
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
- if model.respond_to? :ancestry_column
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
- model.where(model.primary_key => id).update_all(column_name => index + 1)
56
+ updates[column_name] = index + 1
57
+ model.where(model.primary_key => id).update_all(updates)
58
58
  end
59
59
  end
60
60
 
@@ -2,7 +2,7 @@ module ActiveScaffoldSortable
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 3
5
- PATCH = 8
5
+ PATCH = 10
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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.8
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: 2019-06-13 00:00:00.000000000 Z
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
- rubyforge_project:
89
- rubygems_version: 2.7.9
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: