active_scaffold_sortable 3.3.7 → 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: 55dd9474fba326d8334644a34571c7f02fcbfcb099de00d1eacde7a532dc4355
4
- data.tar.gz: 1334a858f24cb8c135e7da1ef46e3ed4089cb19f6fba62c679ebd8187c98db45
3
+ metadata.gz: d70b6e4f025e689fb53925722bb1deda409627cbdcede20161190c3ca10b76b9
4
+ data.tar.gz: 81885ddbf593c12ad5961b22a7a0058a6afdc4c02486fc5125ca582f3181fe51
5
5
  SHA512:
6
- metadata.gz: 39a4ec0b5af215170ae17c1987828e15307bbfafb105b38d27cc463e74db663d34b883f92d0d0f134fe55697a515820420d508d0d1e7782cac760f4b660c4e1c
7
- data.tar.gz: 50037c630d7153dac710e772115f4d8b4ee7655008ffc5f891c0ac02e31c2a74e610d890f0b2390c98ddf0626fd068c8b4caf4f5eaf0d7623275a50f0617d1db
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
 
@@ -1,7 +1,7 @@
1
1
  module ActiveScaffold::Config
2
2
  class Sortable < Base
3
3
  def initialize(core_config)
4
- @core = core_config
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?
@@ -2,7 +2,7 @@ module ActiveScaffoldSortable
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 3
5
- PATCH = 7
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.7
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-04-03 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.8
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: