ransacker_translator 0.1.2 → 0.1.3

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: bcd66f080cb541c4f4deddde0b0168e43c632ac7529a4627316b307dce5dbde4
4
- data.tar.gz: 19b4d1f63e23d63b0fb5932fef02c6f147958a036155d09ac9760f6448e70cdf
3
+ metadata.gz: 8633aee62921eee8dca30c1ffb78be7283e1c348727d0398041c51918b5281c3
4
+ data.tar.gz: 2eda830220d76a5cfeb063fb4636807564b7a39b24fd001201cb725c2b056f26
5
5
  SHA512:
6
- metadata.gz: 43f16bcd68fbc37b149e2f7fb1b54784d9a174679fb6b4f5bddeba29395dfdf8a62ddf6873d15d042008a7ac7d93c16d3312202f1b02924319673cae4e7f79ef
7
- data.tar.gz: 3a58b4a017b74539a195fd353a5986bf03e63d83f231b48b5afc4885a61709655e28bcfad3027c4da65976642cb128f97107efde29e7e6b457108e5263f7f859
6
+ metadata.gz: 424c6b78251e4dc7136cc3957639a023bd0f0ca1ba15720604eaa5c73a0f1c6b677360f21c888d11baaa167ea93653305e0c8ba77d480707c0a755d3dd159c67
7
+ data.tar.gz: e90f11fda5259f4997bf40343001f1996945e2c607cc6056e8d90d138fd56107d8008228705d9a97738fb5f4d3c00a9f5f222d069ca0729f87ac3a5c01001956
data/Rakefile CHANGED
@@ -1,6 +1,12 @@
1
1
  require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
2
+ require 'rake/testtask'
3
3
 
4
- RSpec::Core::RakeTask.new(:spec)
4
+ task :default => [:test]
5
5
 
6
- task :default => :spec
6
+ Rake::TestTask.new do |test|
7
+ test.libs << 'lib'
8
+ test.libs << 'test'
9
+ test.test_files = Dir['test/**/*_test.rb']
10
+ test.warning = false
11
+ # test.verbose = true
12
+ end
@@ -4,14 +4,14 @@ module RansackerTranslator
4
4
  module FormatRansackParameters
5
5
  extend ActiveSupport::Concern
6
6
 
7
- def format_ransack_params
8
- if params[:q].present?
9
- params[:q].keys.each do |key|
10
- if key =~ /_all\z/ || key =~ /_any\z/
11
- params[:q][key] = params[:q][key].split(' ') if params[:q][key].instance_of? String
7
+ private
8
+
9
+ def format_ransack_params
10
+ params[:q]&.keys.each do |key|
11
+ if key.end_with?('_all', '_any') && params.dig(:q, key).instance_of?(String)
12
+ params[:q][key] = params.dig(:q, key).split(' ')
12
13
  end
13
14
  end
14
15
  end
15
- end
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module RansackerTranslator
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -7,11 +7,7 @@ module RansackerTranslator
7
7
  # @param [Symbol] key ransackで使っているキー
8
8
  # @return [String] params[:q][key]を半角スペースでつなげた文字列
9
9
  def ransack_params_array_to_s(key)
10
- if params[:q].present? && params[:q][key].present?
11
- params[:q][key].join(' ')
12
- else
13
- ''
14
- end
10
+ params.dig(:q, key)&.join(' ') || ''
15
11
  end
16
12
 
17
13
  # ransacker_translatorでOR検索に使うキーを返す
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ransacker_translator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - patorash
@@ -118,34 +118,20 @@ dependencies:
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
- - !ruby/object:Gem::Dependency
122
- name: rspec
123
- requirement: !ruby/object:Gem::Requirement
124
- requirements:
125
- - - "~>"
126
- - !ruby/object:Gem::Version
127
- version: '3.0'
128
- type: :development
129
- prerelease: false
130
- version_requirements: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - "~>"
133
- - !ruby/object:Gem::Version
134
- version: '3.0'
135
121
  - !ruby/object:Gem::Dependency
136
122
  name: pry
137
123
  requirement: !ruby/object:Gem::Requirement
138
124
  requirements:
139
125
  - - "~>"
140
126
  - !ruby/object:Gem::Version
141
- version: '0'
127
+ version: '0.14'
142
128
  type: :development
143
129
  prerelease: false
144
130
  version_requirements: !ruby/object:Gem::Requirement
145
131
  requirements:
146
132
  - - "~>"
147
133
  - !ruby/object:Gem::Version
148
- version: '0'
134
+ version: '0.14'
149
135
  - !ruby/object:Gem::Dependency
150
136
  name: database_cleaner
151
137
  requirement: !ruby/object:Gem::Requirement
@@ -160,20 +146,6 @@ dependencies:
160
146
  - - "~>"
161
147
  - !ruby/object:Gem::Version
162
148
  version: '1.7'
163
- - !ruby/object:Gem::Dependency
164
- name: rspec_junit_formatter
165
- requirement: !ruby/object:Gem::Requirement
166
- requirements:
167
- - - "~>"
168
- - !ruby/object:Gem::Version
169
- version: 0.4.1
170
- type: :development
171
- prerelease: false
172
- version_requirements: !ruby/object:Gem::Requirement
173
- requirements:
174
- - - "~>"
175
- - !ruby/object:Gem::Version
176
- version: 0.4.1
177
149
  description: expand search by ransack
178
150
  email:
179
151
  - chariderpato@gmail.com
@@ -201,7 +173,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
173
  requirements:
202
174
  - - ">="
203
175
  - !ruby/object:Gem::Version
204
- version: '0'
176
+ version: 2.6.0
205
177
  required_rubygems_version: !ruby/object:Gem::Requirement
206
178
  requirements:
207
179
  - - ">="