sortable-for-rails 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sortable.rb +7 -2
- data/sortable-for-rails.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d4f1978d91c3ae85a319e349b2e05077d85944f6ff61e26423fc71c032cbc2e
|
4
|
+
data.tar.gz: 50f35f431ae43f0878e4c3976ad7891e684ec13d3b087ae3bbde19422a5ca49e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 251b364b65b0ab7595fac82d29f7903045128bf35b7c35955b4421e390c9025fdc80ea1d22c6772294a88b0de4ac047de135d1310f95c9920f94f4e8f3af2771
|
7
|
+
data.tar.gz: c09f2864a8b4002c54d256eb69e80407c50e67a7c36fac6574186141d1fdb4b2e180a75b445e23d8f7a3562f65d155ebcfbc148a52559ca9cbddc4fd3966c6b8
|
data/lib/sortable.rb
CHANGED
@@ -39,7 +39,7 @@ module Sortable
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def columns
|
42
|
-
@columns
|
42
|
+
@columns ||= create_columns
|
43
43
|
end
|
44
44
|
|
45
45
|
def all
|
@@ -71,8 +71,13 @@ module Sortable
|
|
71
71
|
def create_columns
|
72
72
|
scope.sortable.flat_map do |columns|
|
73
73
|
columns = [columns] unless columns.all? { |column| column.is_a?(Symbol) }
|
74
|
-
columns.map { |column|
|
74
|
+
columns.map { |column| create_column(column) }
|
75
75
|
end.group_by { |column| column.name.to_s }
|
76
76
|
end
|
77
|
+
|
78
|
+
def create_column(column)
|
79
|
+
options = column.respond_to?(:last) && column.last.is_a?(Hash) ? column.pop : {}
|
80
|
+
Column.new(*column, **options)
|
81
|
+
end
|
77
82
|
end
|
78
83
|
end
|
data/sortable-for-rails.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "sortable-for-rails"
|
6
|
-
spec.version = "1.2.
|
6
|
+
spec.version = "1.2.1"
|
7
7
|
spec.authors = ["Grzegorz Derebecki"]
|
8
8
|
spec.email = ["grzegorz.derebecki@fdb.pl"]
|
9
9
|
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.add_dependency "rails", ">= 5.2"
|
29
29
|
spec.add_development_dependency "bundler", "~> 2.0"
|
30
|
-
spec.add_development_dependency "rake", "
|
30
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
31
31
|
spec.add_development_dependency "minitest", "~> 5.0"
|
32
32
|
|
33
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sortable-for-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Derebecki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 12.3.3
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 12.3.3
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
|
-
rubygems_version: 3.
|
112
|
+
rubygems_version: 3.1.2
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: Allow easy sorting tables tables in rails
|