simple_form_ransack 0.0.20 → 0.0.21

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
- SHA1:
3
- metadata.gz: 251d88fbc0152b4c755bb6cca2de131044252b6e
4
- data.tar.gz: 1bff73f27f8f9c3367314674acc8b7dfe6a75212
2
+ SHA256:
3
+ metadata.gz: 7541a435186f0cdaf1e54ef693cca47a72280821cb776d40f3f1cdc5194b2085
4
+ data.tar.gz: 4c64863709a3833f46602c16c4e44bbaaccfacfd7b4affc07e47b162f34abdb0
5
5
  SHA512:
6
- metadata.gz: 2d35f1adc365a1be7fa58ba9c880f20b1619821bb34342659b3b95113d5cbf6643e1381af303dd2e7f23d36b13ca9d4a92d6ca9f0130fec48d34892b3e5cb9d3
7
- data.tar.gz: ba3e7e97a0a6abc90e020bbe57cf43a972f927800ed210b265a1399f60ef04d040e0f1a67fa8e2e79d07d3135a6b75ed65b3e6a4a662ac2edde513f98a1c26a9
6
+ metadata.gz: 394d9db741220ab6b56e3d99ed52608c1ebb761102c654be65a65ada0369954ce738ff76ea4d7c57af8ac20c4a740f60ba3e8217ab6bdd09174d829cd4a92c32
7
+ data.tar.gz: b68f041a36cbff3502b663d85ad86230363ba18d52eecaae9d7f12fc459447a83f732d1df4e23631bbb72cd3d0574b156374f783854294c5cf3e2049ffadf7c5
data/README.md CHANGED
@@ -1,7 +1,3 @@
1
- [![Code Climate](https://codeclimate.com/github/kaspernj/simple_form_ransack/badges/gpa.svg)](https://codeclimate.com/github/kaspernj/simple_form_ransack)
2
- [![Test Coverage](https://codeclimate.com/github/kaspernj/simple_form_ransack/badges/coverage.svg)](https://codeclimate.com/github/kaspernj/simple_form_ransack)
3
- [![Build Status](https://img.shields.io/shippable/540e7b9e3479c5ea8f9ec24f.svg)](https://app.shippable.com/projects/540e7b9e3479c5ea8f9ec24f/builds/latest)
4
-
5
1
  # SimpleFormRansack
6
2
 
7
3
  SimpleForm and Ransack combined.
@@ -26,6 +26,7 @@ class SimpleFormRansack::AttributeInspector
26
26
  if index == @name_parts.length - 1
27
27
  attribute_result = attribute_by_builtup
28
28
  next unless attribute_result
29
+
29
30
  @attribute = attribute_result.fetch(:name)
30
31
  break
31
32
  end
@@ -45,6 +46,7 @@ class SimpleFormRansack::AttributeInspector
45
46
  # Returns true if a complicated label could be generated and simple form should not do this itself.
46
47
  def generated_label?
47
48
  return true if @attribute && @generated_name_classes.any?
49
+
48
50
  false
49
51
  end
50
52
 
@@ -82,6 +84,7 @@ private
82
84
  total_name = @name_builtup.join("_")
83
85
  result = @current_clazz.reflections.find { |name, _reflection| name.to_s == total_name }
84
86
  return {name: result[0], reflection: result[1]} if result
87
+
85
88
  false
86
89
  end
87
90
 
@@ -89,6 +92,7 @@ private
89
92
  total_name = @name_builtup.join("_")
90
93
  result = @current_clazz.attribute_names.find { |name| name.to_s == total_name }
91
94
  return {name: result} if result
95
+
92
96
  false
93
97
  end
94
98
 
@@ -40,7 +40,7 @@ class SimpleFormRansack::FormProxy
40
40
  @form.input(input_manipulator.attribute_name, *args)
41
41
  end
42
42
 
43
- def method_missing(method_name, *args, &blk)
43
+ def method_missing(method_name, *args, &blk) # rubocop:disable Style/MissingRespondToMissing
44
44
  @form.__send__(method_name, *args, &blk)
45
45
  end
46
46
  end
@@ -120,9 +120,10 @@ private
120
120
  return if label_parts.empty?
121
121
 
122
122
  @opts[:label] = label_parts.join
123
- prepend_label_for = %w(cont gteq lteq)
123
+ prepend_label_for = %w[cont gteq lteq]
124
124
 
125
125
  return unless prepend_label_for.include?(@match_type)
126
+
126
127
  @opts[:label] << " #{I18n.t("simple_form_ransack.match_types.#{@match_type}")}"
127
128
  end
128
129
 
@@ -142,7 +143,7 @@ private
142
143
  end
143
144
 
144
145
  def set_value
145
- if @as == "select" || @as == "country"
146
+ if @as == "select" || @as == "country" || @as == "select2"
146
147
  set_value_for_select
147
148
  elsif @as == "check_boxes" || @as == "radio_buttons"
148
149
  set_value_for_checked
@@ -175,6 +176,7 @@ private
175
176
 
176
177
  def set_value_for_boolean
177
178
  return if @input_html.key?(:checked)
179
+
178
180
  @input_html[:checked] = ("checked" if @params[@name] == "1")
179
181
  end
180
182
 
@@ -191,6 +193,7 @@ private
191
193
  def set_include_blank
192
194
  return if @opts.key?(:include_blank)
193
195
  return if @as != "select" && @as != "country"
196
+
194
197
  @opts[:include_blank] = true
195
198
  end
196
199
 
@@ -1,3 +1,3 @@
1
1
  module SimpleFormRansack
2
- VERSION = "0.0.20".freeze
2
+ VERSION = "0.0.21".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_ransack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-11 00:00:00.000000000 Z
11
+ date: 2021-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -42,128 +42,156 @@ dependencies:
42
42
  name: capybara
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 2.6.0
47
+ version: '0'
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: 2.6.0
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: sqlite3
56
+ name: country_select
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.3.9
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.3.9
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rspec-rails
70
+ name: factory_girl_rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 3.7.2
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 3.7.2
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: forgery
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: pry
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - '='
101
+ - - ">="
88
102
  - !ruby/object:Gem::Version
89
- version: 0.10.4
103
+ version: '0'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - '='
108
+ - - ">="
95
109
  - !ruby/object:Gem::Version
96
- version: 0.10.4
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
- name: factory_girl_rails
112
+ name: rspec-rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop
99
127
  requirement: !ruby/object:Gem::Requirement
100
128
  requirements:
101
- - - '='
129
+ - - ">="
102
130
  - !ruby/object:Gem::Version
103
- version: 4.4.1
131
+ version: '0'
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
- - - '='
136
+ - - ">="
109
137
  - !ruby/object:Gem::Version
110
- version: 4.4.1
138
+ version: '0'
111
139
  - !ruby/object:Gem::Dependency
112
- name: forgery
140
+ name: rubocop-performance
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
- - - '='
143
+ - - ">="
116
144
  - !ruby/object:Gem::Version
117
- version: 0.6.0
145
+ version: '0'
118
146
  type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
- - - '='
150
+ - - ">="
123
151
  - !ruby/object:Gem::Version
124
- version: 0.6.0
152
+ version: '0'
125
153
  - !ruby/object:Gem::Dependency
126
- name: simple_form
154
+ name: rubocop-rspec
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
- - - '='
157
+ - - ">="
130
158
  - !ruby/object:Gem::Version
131
- version: 4.0.0
159
+ version: '0'
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
- - - '='
164
+ - - ">="
137
165
  - !ruby/object:Gem::Version
138
- version: 4.0.0
166
+ version: '0'
139
167
  - !ruby/object:Gem::Dependency
140
- name: country_select
168
+ name: simple_form
141
169
  requirement: !ruby/object:Gem::Requirement
142
170
  requirements:
143
- - - '='
171
+ - - ">="
144
172
  - !ruby/object:Gem::Version
145
- version: 2.2.0
173
+ version: '0'
146
174
  type: :development
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
149
177
  requirements:
150
- - - '='
178
+ - - ">="
151
179
  - !ruby/object:Gem::Version
152
- version: 2.2.0
180
+ version: '0'
153
181
  - !ruby/object:Gem::Dependency
154
- name: rubocop
182
+ name: sqlite3
155
183
  requirement: !ruby/object:Gem::Requirement
156
184
  requirements:
157
- - - '='
185
+ - - ">="
158
186
  - !ruby/object:Gem::Version
159
- version: 0.36.0
187
+ version: '0'
160
188
  type: :development
161
189
  prerelease: false
162
190
  version_requirements: !ruby/object:Gem::Requirement
163
191
  requirements:
164
- - - '='
192
+ - - ">="
165
193
  - !ruby/object:Gem::Version
166
- version: 0.36.0
194
+ version: '0'
167
195
  description: Makes it easy to use SimpleForm::FormBuilder with Ransack without constantly
168
196
  having to supply labels and other pains.
169
197
  email:
@@ -187,7 +215,8 @@ files:
187
215
  - lib/tasks/simple_form_ransack_tasks.rake
188
216
  homepage: https://www.github.com/kaspernj/simple_form_ransack
189
217
  licenses: []
190
- metadata: {}
218
+ metadata:
219
+ rubygems_mfa_required: 'true'
191
220
  post_install_message:
192
221
  rdoc_options: []
193
222
  require_paths:
@@ -203,8 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
232
  - !ruby/object:Gem::Version
204
233
  version: '0'
205
234
  requirements: []
206
- rubyforge_project:
207
- rubygems_version: 2.6.13
235
+ rubygems_version: 3.1.6
208
236
  signing_key:
209
237
  specification_version: 4
210
238
  summary: Ransack and SimpleForm combined.