mobility 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5879d6ea43de5adf3be544ef11aaa634adabd6cad56609122450a1c648875f3
4
- data.tar.gz: 7b0a1ed6187a0bb4aa75729c7e894c5673908e2443b50ba0da32f905ba4bf51f
3
+ metadata.gz: 225a8aa8a3eb8691e9a89d60fdd56509b47f7f36d22d1bb8d0c6f485f0e7cc2d
4
+ data.tar.gz: be10ccdea2727e568da790950b4df0633a543094543f7fd5f9c89154d5ea803e
5
5
  SHA512:
6
- metadata.gz: 860741ebf12f984401bac6b03726ac4b10a5c64befbd60a199130154768e6c2c34567009999487dcdaba49f41c12fd73f9fcb86441d9e7ad71b7d59adb4976a6
7
- data.tar.gz: 27f2da6d8118a5b582035d721437f71520b2d4bcb81f8dba63c81f77b8c2d2e3badc6ec98349086e9c7fa651d62df38255c495cc76dccc0bb2bb6a988458e007
6
+ metadata.gz: 6f350d0a8e5fcf4f1804716f2cdfc0d500abd033ca0243e0c6be663adedf3ee192d785546a1be1274acbd5738533c7b5e3b9f8c48446e22bde39c26de8217819
7
+ data.tar.gz: 78fb7729118181d00e21f78c1144166916270e555bb4191c05a10cc660fb57d36b8af034cc7d42bfbd3d66d9509d1686f80554f85538b9a6d0fd488becd12966
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,7 +1,16 @@
1
1
  # Mobility Changelog
2
2
 
3
+ ## Unreleased
4
+ - Assign blank values in pg hash backends
5
+ ([#516](https://github.com/shioyama/mobility/pull/516))
6
+
3
7
  ## 1.1
4
8
 
9
+ ### 1.1.3
10
+ - Do not swallow keyword args on ruby 3 in fallthrough accessors
11
+ ([#520](https://github.com/shioyama/mobility/pull/520)) thanks
12
+ [doits](https://github.com/doits)!
13
+
5
14
  ### 1.1.2
6
15
  - Check whether class responds to mobility_attribute?
7
16
  ([#515](https://github.com/shioyama/mobility/pull/515))
data/Gemfile CHANGED
@@ -12,8 +12,8 @@ group :development, :test do
12
12
  case orm_version
13
13
  when '4.2', '5.0', '5.1', '5.2', '6.0', '6.1'
14
14
  gem 'activerecord', "~> #{orm_version}.0"
15
- when '6.2'
16
- git 'https://github.com/rails/rails.git' do
15
+ when '7.0'
16
+ git 'https://github.com/rails/rails.git', branch: 'main' do
17
17
  gem 'activerecord'
18
18
  gem 'activesupport'
19
19
  end
data/Gemfile.lock CHANGED
@@ -1,24 +1,7 @@
1
- GIT
2
- remote: https://github.com/rails/rails.git
3
- revision: ac3910791d0294f6721e5a39e0063aa005535f10
4
- branch: main
5
- specs:
6
- activemodel (7.0.0.alpha)
7
- activesupport (= 7.0.0.alpha)
8
- activerecord (7.0.0.alpha)
9
- activemodel (= 7.0.0.alpha)
10
- activesupport (= 7.0.0.alpha)
11
- activesupport (7.0.0.alpha)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 1.6, < 2)
14
- minitest (>= 5.1)
15
- tzinfo (~> 2.0)
16
- zeitwerk (~> 2.3)
17
-
18
1
  PATH
19
2
  remote: .
20
3
  specs:
21
- mobility (1.1.1)
4
+ mobility (1.1.2)
22
5
  i18n (>= 0.6.10, < 2)
23
6
  request_store (~> 1.0)
24
7
 
@@ -54,7 +37,6 @@ GEM
54
37
  rb-inotify (~> 0.9, >= 0.9.10)
55
38
  lumberjack (1.2.8)
56
39
  method_source (1.0.0)
57
- minitest (5.14.4)
58
40
  nenv (0.3.0)
59
41
  notiffany (0.1.3)
60
42
  nenv (~> 0.1)
@@ -86,19 +68,15 @@ GEM
86
68
  diff-lcs (>= 1.2.0, < 2.0)
87
69
  rspec-support (~> 3.10.0)
88
70
  rspec-support (3.10.2)
71
+ sequel (5.44.0)
89
72
  shellany (0.0.1)
90
73
  thor (1.1.0)
91
- tzinfo (2.0.4)
92
- concurrent-ruby (~> 1.0)
93
74
  yard (0.9.26)
94
- zeitwerk (2.4.2)
95
75
 
96
76
  PLATFORMS
97
77
  ruby
98
78
 
99
79
  DEPENDENCIES
100
- activerecord!
101
- activesupport!
102
80
  benchmark-ips
103
81
  database_cleaner (~> 1.5, >= 1.5.3)
104
82
  guard-rspec
@@ -107,6 +85,7 @@ DEPENDENCIES
107
85
  pry-byebug
108
86
  rake (~> 12, >= 12.2.1)
109
87
  rspec (~> 3.0)
88
+ sequel (~> 5.0)
110
89
  yard (~> 0.9.0)
111
90
 
112
91
  BUNDLED WITH
data/README.md CHANGED
@@ -55,7 +55,7 @@ Installation
55
55
  Add this line to your application's Gemfile:
56
56
 
57
57
  ```ruby
58
- gem 'mobility', '~> 1.1.2'
58
+ gem 'mobility', '~> 1.1.3'
59
59
  ```
60
60
 
61
61
  ### ActiveRecord (Rails)
data/lib/mobility.rb CHANGED
@@ -73,6 +73,9 @@ fallbacks plugin, whereas +Post+ uses +Translations+ which does not have that
73
73
  plugin enabled.
74
74
 
75
75
  =end
76
+
77
+ def ruby2_keywords(*); end unless respond_to?(:ruby2_keywords, true)
78
+
76
79
  module Mobility
77
80
  # A generic exception used by Mobility.
78
81
  class Error < StandardError
@@ -32,7 +32,7 @@ Internal class used by ActiveRecord backends backed by a Postgres data type
32
32
  def self.dump(obj)
33
33
  if obj.is_a? ::Hash
34
34
  obj.inject({}) do |translations, (locale, value)|
35
- translations[locale] = value if value.present?
35
+ translations[locale] = value unless value.nil?
36
36
  translations
37
37
  end
38
38
  else
@@ -41,7 +41,7 @@ jsonb).
41
41
  mod = Module.new do
42
42
  define_method :before_validation do
43
43
  columns.each do |column|
44
- self[column].delete_if { |_, v| Util.blank?(v) }
44
+ self[column].delete_if { |_, v| v.nil? }
45
45
  end
46
46
  super()
47
47
  end
@@ -40,7 +40,7 @@ Format for serialization. Either +:yaml+ (default) or +:json+.
40
40
  return if obj.nil?
41
41
  if obj.is_a? ::Hash
42
42
  obj = obj.inject({}) do |translations, (locale, value)|
43
- translations[locale] = value.to_s if Util.present?(value)
43
+ translations[locale] = value.to_s unless value.nil?
44
44
  translations
45
45
  end
46
46
  else
@@ -55,6 +55,13 @@ model class is generated.
55
55
  end
56
56
  end
57
57
 
58
+ # Following is needed in order to not swallow `kwargs` on ruby >= 3.0.
59
+ # Otherwise `kwargs` are not passed by `super` to a possible other
60
+ # `method_missing` defined like this:
61
+ #
62
+ # def method_missing(name, *args, **kwargs, &block); end
63
+ ruby2_keywords :method_missing
64
+
58
65
  define_method :respond_to_missing? do |method_name, include_private = false|
59
66
  (method_name =~ method_name_regex) || super(method_name, include_private)
60
67
  end
@@ -8,7 +8,7 @@ module Mobility
8
8
  module VERSION
9
9
  MAJOR = 1
10
10
  MINOR = 1
11
- TINY = 2
11
+ TINY = 3
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Salzberg
@@ -34,7 +34,7 @@ cert_chain:
34
34
  eBMcZq0d1tbtv1M1UXND9mOfhLZ31YvoSTPkrJiRpljUNgD0+ugelnr1/5X/9k8y
35
35
  J9QOd3C5jpSShf/HMvpJnFuSYFm19cH9GrHjvw==
36
36
  -----END CERTIFICATE-----
37
- date: 2021-04-26 00:00:00.000000000 Z
37
+ date: 2021-08-06 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: request_store
metadata.gz.sig CHANGED
Binary file