mobility-ransack 0.2.2 → 1.0.0.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -7
- data/Gemfile.lock +121 -104
- data/README.md +1 -1
- data/lib/mobility/plugins/ransack.rb +19 -9
- data/lib/mobility/ransack/version.rb +1 -1
- metadata +27 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3df672b8192defc4e9888ff5d5e11d8321611a5ed8f14903499e481447d7530
|
4
|
+
data.tar.gz: 656a8ca330a761e02595f58670dce0f9dd7a705192e82d17e7357909cf0b8301
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c31d6ddadc41ac4538220aafa399beaf2d99cdb93145ba38d6aa1ca8af276bc817934597c2d85db16edd70c24fbb9922b8382a859441d30b597f8a24667f6cf
|
7
|
+
data.tar.gz: 0dceb9bafd2fc61681afe5fe37b1fdb37c19625749772ca0ad6d91659df9b4c63d3fd76f043fbf7d845a59f42b5c665c6a57d7117439c4cebea7f1d73df6cfb3
|
data/Gemfile
CHANGED
@@ -6,13 +6,7 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
|
6
6
|
gemspec
|
7
7
|
|
8
8
|
group :development, :test do
|
9
|
-
|
10
|
-
gem 'rails', '>= 5.1', '< 5.2'
|
11
|
-
elsif ENV['RAILS_VERSION'] == '5.0'
|
12
|
-
gem 'rails', '>= 5.0', '< 5.1'
|
13
|
-
else
|
14
|
-
gem 'rails', '>= 5.2.0.rc2', '< 5.3'
|
15
|
-
end
|
9
|
+
gem 'rails', "~> #{ENV['RAILS_VERSION'] || '6.0'}"
|
16
10
|
|
17
11
|
gem 'pry'
|
18
12
|
gem 'pry-byebug'
|
data/Gemfile.lock
CHANGED
@@ -1,168 +1,185 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mobility-ransack (0.2.
|
4
|
+
mobility-ransack (0.2.2)
|
5
5
|
mobility (~> 0.8.0)
|
6
|
-
ransack (>= 1.8.0, <
|
6
|
+
ransack (>= 1.8.0, < 3.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (
|
12
|
-
actionpack (=
|
11
|
+
actioncable (6.0.3.4)
|
12
|
+
actionpack (= 6.0.3.4)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
|
16
|
-
actionpack (=
|
17
|
-
|
18
|
-
|
15
|
+
actionmailbox (6.0.3.4)
|
16
|
+
actionpack (= 6.0.3.4)
|
17
|
+
activejob (= 6.0.3.4)
|
18
|
+
activerecord (= 6.0.3.4)
|
19
|
+
activestorage (= 6.0.3.4)
|
20
|
+
activesupport (= 6.0.3.4)
|
21
|
+
mail (>= 2.7.1)
|
22
|
+
actionmailer (6.0.3.4)
|
23
|
+
actionpack (= 6.0.3.4)
|
24
|
+
actionview (= 6.0.3.4)
|
25
|
+
activejob (= 6.0.3.4)
|
19
26
|
mail (~> 2.5, >= 2.5.4)
|
20
27
|
rails-dom-testing (~> 2.0)
|
21
|
-
actionpack (
|
22
|
-
actionview (=
|
23
|
-
activesupport (=
|
24
|
-
rack (~> 2.0)
|
28
|
+
actionpack (6.0.3.4)
|
29
|
+
actionview (= 6.0.3.4)
|
30
|
+
activesupport (= 6.0.3.4)
|
31
|
+
rack (~> 2.0, >= 2.0.8)
|
25
32
|
rack-test (>= 0.6.3)
|
26
33
|
rails-dom-testing (~> 2.0)
|
27
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
28
|
-
|
29
|
-
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
+
actiontext (6.0.3.4)
|
36
|
+
actionpack (= 6.0.3.4)
|
37
|
+
activerecord (= 6.0.3.4)
|
38
|
+
activestorage (= 6.0.3.4)
|
39
|
+
activesupport (= 6.0.3.4)
|
40
|
+
nokogiri (>= 1.8.5)
|
41
|
+
actionview (6.0.3.4)
|
42
|
+
activesupport (= 6.0.3.4)
|
30
43
|
builder (~> 3.1)
|
31
44
|
erubi (~> 1.4)
|
32
45
|
rails-dom-testing (~> 2.0)
|
33
|
-
rails-html-sanitizer (~> 1.
|
34
|
-
activejob (
|
35
|
-
activesupport (=
|
46
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
+
activejob (6.0.3.4)
|
48
|
+
activesupport (= 6.0.3.4)
|
36
49
|
globalid (>= 0.3.6)
|
37
|
-
activemodel (
|
38
|
-
activesupport (=
|
39
|
-
activerecord (
|
40
|
-
activemodel (=
|
41
|
-
activesupport (=
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
activerecord (=
|
50
|
+
activemodel (6.0.3.4)
|
51
|
+
activesupport (= 6.0.3.4)
|
52
|
+
activerecord (6.0.3.4)
|
53
|
+
activemodel (= 6.0.3.4)
|
54
|
+
activesupport (= 6.0.3.4)
|
55
|
+
activestorage (6.0.3.4)
|
56
|
+
actionpack (= 6.0.3.4)
|
57
|
+
activejob (= 6.0.3.4)
|
58
|
+
activerecord (= 6.0.3.4)
|
46
59
|
marcel (~> 0.3.1)
|
47
|
-
activesupport (
|
60
|
+
activesupport (6.0.3.4)
|
48
61
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
49
62
|
i18n (>= 0.7, < 2)
|
50
63
|
minitest (~> 5.1)
|
51
64
|
tzinfo (~> 1.1)
|
52
|
-
|
53
|
-
builder (3.2.
|
54
|
-
byebug (
|
65
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
66
|
+
builder (3.2.4)
|
67
|
+
byebug (11.1.1)
|
55
68
|
coderay (1.1.2)
|
56
|
-
concurrent-ruby (1.
|
57
|
-
crass (1.0.
|
58
|
-
database_cleaner (1.
|
69
|
+
concurrent-ruby (1.1.7)
|
70
|
+
crass (1.0.6)
|
71
|
+
database_cleaner (1.8.4)
|
59
72
|
diff-lcs (1.3)
|
60
|
-
erubi (1.
|
61
|
-
globalid (0.4.
|
73
|
+
erubi (1.9.0)
|
74
|
+
globalid (0.4.2)
|
62
75
|
activesupport (>= 4.2.0)
|
63
|
-
i18n (1.
|
76
|
+
i18n (1.8.5)
|
64
77
|
concurrent-ruby (~> 1.0)
|
65
|
-
loofah (2.
|
78
|
+
loofah (2.7.0)
|
66
79
|
crass (~> 1.0.2)
|
67
80
|
nokogiri (>= 1.5.9)
|
68
|
-
mail (2.7.
|
81
|
+
mail (2.7.1)
|
69
82
|
mini_mime (>= 0.1.1)
|
70
|
-
marcel (0.3.
|
83
|
+
marcel (0.3.3)
|
71
84
|
mimemagic (~> 0.3.2)
|
72
|
-
method_source (0.
|
73
|
-
mimemagic (0.3.
|
74
|
-
mini_mime (1.0.
|
75
|
-
mini_portile2 (2.
|
76
|
-
minitest (5.
|
77
|
-
mobility (0.8.
|
78
|
-
i18n (>= 0.6.10, <
|
85
|
+
method_source (1.0.0)
|
86
|
+
mimemagic (0.3.5)
|
87
|
+
mini_mime (1.0.2)
|
88
|
+
mini_portile2 (2.4.0)
|
89
|
+
minitest (5.14.2)
|
90
|
+
mobility (0.8.13)
|
91
|
+
i18n (>= 0.6.10, < 2)
|
79
92
|
request_store (~> 1.0)
|
80
|
-
nio4r (2.
|
81
|
-
nokogiri (1.
|
82
|
-
mini_portile2 (~> 2.
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
93
|
+
nio4r (2.5.4)
|
94
|
+
nokogiri (1.10.10)
|
95
|
+
mini_portile2 (~> 2.4.0)
|
96
|
+
polyamorous (2.3.2)
|
97
|
+
activerecord (>= 5.2.1)
|
98
|
+
pry (0.13.0)
|
99
|
+
coderay (~> 1.1)
|
100
|
+
method_source (~> 1.0)
|
101
|
+
pry-byebug (3.9.0)
|
102
|
+
byebug (~> 11.0)
|
103
|
+
pry (~> 0.13.0)
|
104
|
+
rack (2.2.3)
|
90
105
|
rack-test (1.1.0)
|
91
106
|
rack (>= 1.0, < 3)
|
92
|
-
rails (
|
93
|
-
actioncable (=
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
107
|
+
rails (6.0.3.4)
|
108
|
+
actioncable (= 6.0.3.4)
|
109
|
+
actionmailbox (= 6.0.3.4)
|
110
|
+
actionmailer (= 6.0.3.4)
|
111
|
+
actionpack (= 6.0.3.4)
|
112
|
+
actiontext (= 6.0.3.4)
|
113
|
+
actionview (= 6.0.3.4)
|
114
|
+
activejob (= 6.0.3.4)
|
115
|
+
activemodel (= 6.0.3.4)
|
116
|
+
activerecord (= 6.0.3.4)
|
117
|
+
activestorage (= 6.0.3.4)
|
118
|
+
activesupport (= 6.0.3.4)
|
102
119
|
bundler (>= 1.3.0)
|
103
|
-
railties (=
|
120
|
+
railties (= 6.0.3.4)
|
104
121
|
sprockets-rails (>= 2.0.0)
|
105
122
|
rails-dom-testing (2.0.3)
|
106
123
|
activesupport (>= 4.2.0)
|
107
124
|
nokogiri (>= 1.6)
|
108
|
-
rails-html-sanitizer (1.0
|
109
|
-
loofah (~> 2.
|
110
|
-
railties (
|
111
|
-
actionpack (=
|
112
|
-
activesupport (=
|
125
|
+
rails-html-sanitizer (1.3.0)
|
126
|
+
loofah (~> 2.3)
|
127
|
+
railties (6.0.3.4)
|
128
|
+
actionpack (= 6.0.3.4)
|
129
|
+
activesupport (= 6.0.3.4)
|
113
130
|
method_source
|
114
131
|
rake (>= 0.8.7)
|
115
|
-
thor (>= 0.
|
116
|
-
rake (
|
117
|
-
ransack (2.
|
118
|
-
|
119
|
-
|
120
|
-
activesupport (>= 5.0)
|
132
|
+
thor (>= 0.20.3, < 2.0)
|
133
|
+
rake (13.0.1)
|
134
|
+
ransack (2.3.2)
|
135
|
+
activerecord (>= 5.2.1)
|
136
|
+
activesupport (>= 5.2.1)
|
121
137
|
i18n
|
122
|
-
|
138
|
+
polyamorous (= 2.3.2)
|
139
|
+
request_store (1.5.0)
|
123
140
|
rack (>= 1.4)
|
124
|
-
rspec (3.
|
125
|
-
rspec-core (~> 3.
|
126
|
-
rspec-expectations (~> 3.
|
127
|
-
rspec-mocks (~> 3.
|
128
|
-
rspec-core (3.
|
129
|
-
rspec-support (~> 3.
|
130
|
-
rspec-expectations (3.
|
141
|
+
rspec (3.9.0)
|
142
|
+
rspec-core (~> 3.9.0)
|
143
|
+
rspec-expectations (~> 3.9.0)
|
144
|
+
rspec-mocks (~> 3.9.0)
|
145
|
+
rspec-core (3.9.1)
|
146
|
+
rspec-support (~> 3.9.1)
|
147
|
+
rspec-expectations (3.9.1)
|
131
148
|
diff-lcs (>= 1.2.0, < 2.0)
|
132
|
-
rspec-support (~> 3.
|
133
|
-
rspec-mocks (3.
|
149
|
+
rspec-support (~> 3.9.0)
|
150
|
+
rspec-mocks (3.9.1)
|
134
151
|
diff-lcs (>= 1.2.0, < 2.0)
|
135
|
-
rspec-support (~> 3.
|
136
|
-
rspec-support (3.
|
137
|
-
sprockets (
|
152
|
+
rspec-support (~> 3.9.0)
|
153
|
+
rspec-support (3.9.2)
|
154
|
+
sprockets (4.0.2)
|
138
155
|
concurrent-ruby (~> 1.0)
|
139
156
|
rack (> 1, < 3)
|
140
|
-
sprockets-rails (3.2.
|
157
|
+
sprockets-rails (3.2.2)
|
141
158
|
actionpack (>= 4.0)
|
142
159
|
activesupport (>= 4.0)
|
143
160
|
sprockets (>= 3.0.0)
|
144
|
-
sqlite3 (1.
|
145
|
-
thor (0.
|
161
|
+
sqlite3 (1.4.2)
|
162
|
+
thor (1.0.1)
|
146
163
|
thread_safe (0.3.6)
|
147
|
-
tzinfo (1.2.
|
164
|
+
tzinfo (1.2.7)
|
148
165
|
thread_safe (~> 0.1)
|
149
|
-
websocket-driver (0.7.
|
166
|
+
websocket-driver (0.7.3)
|
150
167
|
websocket-extensions (>= 0.1.0)
|
151
|
-
websocket-extensions (0.1.
|
168
|
+
websocket-extensions (0.1.5)
|
169
|
+
zeitwerk (2.4.1)
|
152
170
|
|
153
171
|
PLATFORMS
|
154
172
|
ruby
|
155
173
|
|
156
174
|
DEPENDENCIES
|
157
|
-
database_cleaner (~> 1.7.0)
|
175
|
+
database_cleaner (~> 1.7, >= 1.7.0)
|
158
176
|
mobility-ransack!
|
159
177
|
pry
|
160
178
|
pry-byebug
|
161
|
-
rails (
|
162
|
-
rake (
|
163
|
-
ransack (~> 2.0.0)
|
179
|
+
rails (~> 6.0)
|
180
|
+
rake (>= 12.3.3)
|
164
181
|
rspec (~> 3.0)
|
165
|
-
sqlite3
|
182
|
+
sqlite3 (~> 1.3, >= 1.3.0)
|
166
183
|
|
167
184
|
BUNDLED WITH
|
168
|
-
|
185
|
+
2.0.2
|
data/README.md
CHANGED
@@ -4,21 +4,28 @@ require "mobility"
|
|
4
4
|
module Mobility
|
5
5
|
module Plugins
|
6
6
|
module Ransack
|
7
|
+
extend Plugin
|
8
|
+
|
9
|
+
default true
|
10
|
+
requires :backend, include: :before
|
11
|
+
requires :active_record
|
12
|
+
|
7
13
|
# Applies ransack plugin.
|
8
14
|
# @param [Attributes] attributes
|
9
15
|
# @param [Boolean] option
|
10
|
-
|
11
|
-
if
|
12
|
-
|
13
|
-
|
14
|
-
model_class.ransacker(attr) { backend_class.build_node(attr, Mobility.locale) }
|
16
|
+
included_hook do |klass, backend_class|
|
17
|
+
if options[:ransack]
|
18
|
+
names.each do |name|
|
19
|
+
klass.ransacker(name) { backend_class.build_node(name, Mobility.locale) }
|
15
20
|
end
|
16
|
-
|
21
|
+
klass.extend ClassMethods
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
20
|
-
|
21
|
-
|
25
|
+
module ClassMethods
|
26
|
+
def ransack(*)
|
27
|
+
super.extend(Search)
|
28
|
+
end
|
22
29
|
end
|
23
30
|
|
24
31
|
module Search
|
@@ -35,11 +42,14 @@ module Mobility
|
|
35
42
|
private
|
36
43
|
|
37
44
|
def apply_mobility_scope(relation, predicate, attributes)
|
38
|
-
|
45
|
+
mobility_attributes = attributes.select { |attr| object.mobility_attribute?(attr) }
|
46
|
+
mobility_attributes.inject(relation) do |i18n_rel, attr|
|
39
47
|
object.mobility_backend_class(attr).apply_scope(i18n_rel, predicate)
|
40
48
|
end
|
41
49
|
end
|
42
50
|
end
|
43
51
|
end
|
52
|
+
|
53
|
+
register_plugin(:ransack, Ransack)
|
44
54
|
end
|
45
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobility-ransack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Salzberg
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ransack
|
@@ -36,28 +36,28 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.
|
39
|
+
version: 1.0.0.beta1
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
46
|
+
version: 1.0.0.beta1
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 12.3.3
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: 12.3.3
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rspec
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,43 +76,43 @@ dependencies:
|
|
76
76
|
name: sqlite3
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '1.3'
|
82
79
|
- - ">="
|
83
80
|
- !ruby/object:Gem::Version
|
84
81
|
version: 1.3.0
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '1.3'
|
85
85
|
type: :development
|
86
86
|
prerelease: false
|
87
87
|
version_requirements: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- - "~>"
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: '1.3'
|
92
89
|
- - ">="
|
93
90
|
- !ruby/object:Gem::Version
|
94
91
|
version: 1.3.0
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '1.3'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: database_cleaner
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- - "~>"
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '1.7'
|
102
99
|
- - ">="
|
103
100
|
- !ruby/object:Gem::Version
|
104
101
|
version: 1.7.0
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '1.7'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - "~>"
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '1.7'
|
112
109
|
- - ">="
|
113
110
|
- !ruby/object:Gem::Version
|
114
111
|
version: 1.7.0
|
115
|
-
|
112
|
+
- - "~>"
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '1.7'
|
115
|
+
description:
|
116
116
|
email:
|
117
117
|
- chris@dejimata.com
|
118
118
|
executables: []
|
@@ -132,7 +132,7 @@ homepage: https://github.com/shioyama/mobility-ransack
|
|
132
132
|
licenses:
|
133
133
|
- MIT
|
134
134
|
metadata: {}
|
135
|
-
post_install_message:
|
135
|
+
post_install_message:
|
136
136
|
rdoc_options: []
|
137
137
|
require_paths:
|
138
138
|
- lib
|
@@ -143,13 +143,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
145
|
requirements:
|
146
|
-
- - "
|
146
|
+
- - ">"
|
147
147
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
148
|
+
version: 1.3.1
|
149
149
|
requirements: []
|
150
|
-
|
151
|
-
|
152
|
-
signing_key:
|
150
|
+
rubygems_version: 3.0.6
|
151
|
+
signing_key:
|
153
152
|
specification_version: 4
|
154
153
|
summary: Search attributes translated by Mobility with Ransack.
|
155
154
|
test_files: []
|