mobility-ransack 1.0.0 → 1.0.1

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: 9e2b2fb4a83837ab504f3094122475e7f3dd47370419e475553eb6a50dcd32b6
4
- data.tar.gz: afbe3bacb2c1acbf5d2e83f07c72e03f51ff02aab08b1de8e00f59ecb4ba06b8
3
+ metadata.gz: be276922cefff8fd33e93a926cc1a4bf34121c9749dfe139be50c273bd2394f5
4
+ data.tar.gz: d8a30f2fe726f735157480c34ed9735b82acbb62dcd5ec0e32795842d548d740
5
5
  SHA512:
6
- metadata.gz: 9746d4b0acf3509a5080bfc091b364cc4774b4e62e2c43824f68c286f5c2d2c3776f31024b5b13d113d2b1324abba4745f5b8cba2bb31d0927f86a572f87582f
7
- data.tar.gz: a17f31df6addb9f42a6c22e0a081746dc9a07d67538596588801bab37d2ce210105921e3193e1019c1b4bbab99d895965e6994d6ee90e1d0c45ddf068a89fc44
6
+ metadata.gz: 86be049fae7d2990b93d9e851d0ff719aeb01aef19c708a6ef981ff53390598211a7cd464dd5e00dbf57e502479e3881de13f244b3b4aa2fade0728ff2335f6e
7
+ data.tar.gz: e31549972b7c78b82147d56ba983616d33fe8a155e232a87665c328dc55e5fd60cabe13a5b379aa8a4be40dd058145d22246365c18ac6d9b18cdfcbd442d5583
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Mobility Ransack Changelog
2
2
 
3
+ ## 1.0
4
+
5
+ ### 1.0.1
6
+ - Update gemspec to support Mobility 1.x
7
+ ([#17](https://github.com/shioyama/mobility-ransack/pull/17))
8
+
9
+ ### 1.0.0
10
+ - Enable Mobility 1.x compatibility
11
+ ([#10](https://github.com/shioyama/mobility-ransack/pull/10))
12
+
3
13
  ## 0.2
4
14
 
5
15
  ### 0.2.2
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6
6
  gemspec
7
7
 
8
8
  group :development, :test do
9
- gem 'rails', "~> #{ENV['RAILS_VERSION'] || '6.0'}"
9
+ gem 'rails', "~> #{ENV['RAILS_VERSION'] || '6.1'}.0"
10
10
 
11
11
  gem 'pry'
12
12
  gem 'pry-byebug'
data/Gemfile.lock CHANGED
@@ -173,7 +173,7 @@ DEPENDENCIES
173
173
  mobility-ransack!
174
174
  pry
175
175
  pry-byebug
176
- rails (~> 6.0)
176
+ rails (~> 6.0.0)
177
177
  rake (>= 12.3.3)
178
178
  rspec (~> 3.0)
179
179
  sqlite3 (~> 1.3, >= 1.3.0)
data/README.md CHANGED
@@ -18,7 +18,7 @@ Search on translated attributes with
18
18
  Just add the gem to your Gemfile:
19
19
 
20
20
  ```ruby
21
- gem 'mobility-ransack', '~> 1.0.0'
21
+ gem 'mobility-ransack', '~> 1.0.1'
22
22
  ```
23
23
 
24
24
  (For Mobility versions earlier than 1.0, replace `1.0.0` with `0.2.2`, but be
@@ -35,15 +35,14 @@ module Mobility
35
35
  apply_mobility_scope(relation, predicate, [sort.attr_name])
36
36
  end
37
37
  conditions.inject(sorted) do |relation, condition|
38
- apply_mobility_scope(relation, condition.arel_predicate, condition.attributes.compact.flatten.map(&:name))
38
+ apply_mobility_scope(relation, condition.arel_predicate, condition.attributes.compact.flat_map(&:name))
39
39
  end
40
40
  end
41
41
 
42
42
  private
43
43
 
44
44
  def apply_mobility_scope(relation, predicate, attributes)
45
- mobility_attributes = attributes.select { |attr| object.mobility_attribute?(attr) }
46
- mobility_attributes.inject(relation) do |i18n_rel, attr|
45
+ (attributes & object.mobility_attributes).inject(relation) do |i18n_rel, attr|
47
46
  object.mobility_backend_class(attr).apply_scope(i18n_rel, predicate)
48
47
  end
49
48
  end
@@ -1,5 +1,5 @@
1
1
  module Mobility
2
2
  module Ransack
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Salzberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-17 00:00:00.000000000 Z
11
+ date: 2021-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ransack
@@ -34,16 +34,22 @@ dependencies:
34
34
  name: mobility
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 1.0.1
40
+ - - "<"
38
41
  - !ruby/object:Gem::Version
39
- version: 1.0.0
42
+ version: '2.0'
40
43
  type: :runtime
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
44
- - - "~>"
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 1.0.1
50
+ - - "<"
45
51
  - !ruby/object:Gem::Version
46
- version: 1.0.0
52
+ version: '2.0'
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: rake
49
55
  requirement: !ruby/object:Gem::Requirement