mobility 1.2.7 → 1.2.8

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: f9ff30d2d033cff7555cc4a4ed4d463d7670df67e4e23302534f35fc6bf34649
4
- data.tar.gz: d3097e35c0d8e6fc65c88fc038fcb056add50c4a87384ece6e71321c33a71aac
3
+ metadata.gz: 17bc48ee3eb32c8a9590bd2272a584cd2c6419464acd55466513e0d2e3c296f2
4
+ data.tar.gz: e29dbc1fb5276e466e3da8d8d88bf0ac6c993589dcb69603ac90881b33296b0b
5
5
  SHA512:
6
- metadata.gz: 10b8f7d41910f51e21fbf6ad5603e284070c202d224518b788067df6ea4fc77f180b2273498307a8f5d77f88963eee06917bea68f51a41d98308c60bc2091cf5
7
- data.tar.gz: 20cdcc3adc28dae960ea83a58b1aa2ba92515e824a6ebe35a4bb3d896c9b0eae3aae0b8198c32304dfb9d2eec8a794b427a50f3f4f0c75e0b2e8d307ad40fb69
6
+ metadata.gz: b938078ab08169631d98f8437109f391ab6ea942813652be76f30b94d986753aa0c0fb826b1e3e738372dc874273d944a2082afe97a4799a8648e39002d340f3
7
+ data.tar.gz: 99c18855141b073b7530eae978c7873727d40ef4e6eb22d7f5c84a0c4880e20f1586f3293776cde460794cc37ff88710a6b612b5a3552a4f6ee39abca074e347
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## 1.2
4
4
 
5
+ ### 1.2.8
6
+ - Fix issues with subclassing, such as when using AR STI,
7
+ fixes [#566](https://github.com/shioyama/mobility/issues/566)
8
+ ([#568](https://github.com/shioyama/mobility/pull/568))
9
+ - Handle attribute_method_matchers rename (part of #560)
10
+
5
11
  ### 1.2.7
6
12
  - Do not query same attribute more than once, fixes
7
13
  [#564](https://github.com/shioyama/mobility/pull/578)
data/Gemfile.lock CHANGED
@@ -1,3 +1,20 @@
1
+ GIT
2
+ remote: https://github.com/rails/rails.git
3
+ revision: ed3130a41d7728b2e650c1b9093545e0d06af489
4
+ branch: main
5
+ specs:
6
+ activemodel (7.1.0.alpha)
7
+ activesupport (= 7.1.0.alpha)
8
+ activerecord (7.1.0.alpha)
9
+ activemodel (= 7.1.0.alpha)
10
+ activesupport (= 7.1.0.alpha)
11
+ activesupport (7.1.0.alpha)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ connection_pool (>= 2.2.5)
14
+ i18n (>= 1.6, < 2)
15
+ minitest (>= 5.1)
16
+ tzinfo (~> 2.0)
17
+
1
18
  PATH
2
19
  remote: .
3
20
  specs:
@@ -8,14 +25,15 @@ PATH
8
25
  GEM
9
26
  remote: https://rubygems.org/
10
27
  specs:
11
- benchmark-ips (2.9.1)
28
+ benchmark-ips (2.10.0)
12
29
  byebug (11.1.3)
13
30
  coderay (1.1.3)
14
- concurrent-ruby (1.1.9)
31
+ concurrent-ruby (1.1.10)
32
+ connection_pool (2.2.5)
15
33
  database_cleaner (1.99.0)
16
- diff-lcs (1.4.4)
17
- ffi (1.15.4)
18
- formatador (0.3.0)
34
+ diff-lcs (1.5.0)
35
+ ffi (1.15.5)
36
+ formatador (1.1.0)
19
37
  guard (2.18.0)
20
38
  formatador (>= 0.2.4)
21
39
  listen (>= 2.7, < 4.0)
@@ -30,13 +48,14 @@ GEM
30
48
  guard (~> 2.1)
31
49
  guard-compat (~> 1.1)
32
50
  rspec (>= 2.99.0, < 4.0)
33
- i18n (1.8.10)
51
+ i18n (1.10.0)
34
52
  concurrent-ruby (~> 1.0)
35
- listen (3.7.0)
53
+ listen (3.7.1)
36
54
  rb-fsevent (~> 0.10, >= 0.10.3)
37
55
  rb-inotify (~> 0.9, >= 0.9.10)
38
56
  lumberjack (1.2.8)
39
57
  method_source (1.0.0)
58
+ minitest (5.16.0)
40
59
  nenv (0.3.0)
41
60
  notiffany (0.1.3)
42
61
  nenv (~> 0.1)
@@ -48,35 +67,40 @@ GEM
48
67
  pry-byebug (3.9.0)
49
68
  byebug (~> 11.0)
50
69
  pry (~> 0.13.0)
51
- rack (2.2.3)
70
+ rack (2.2.3.1)
52
71
  rake (12.3.3)
53
- rb-fsevent (0.11.0)
72
+ rb-fsevent (0.11.1)
54
73
  rb-inotify (0.10.1)
55
74
  ffi (~> 1.0)
56
- request_store (1.5.0)
75
+ request_store (1.5.1)
57
76
  rack (>= 1.4)
58
- rspec (3.10.0)
59
- rspec-core (~> 3.10.0)
60
- rspec-expectations (~> 3.10.0)
61
- rspec-mocks (~> 3.10.0)
62
- rspec-core (3.10.1)
63
- rspec-support (~> 3.10.0)
64
- rspec-expectations (3.10.1)
77
+ rspec (3.11.0)
78
+ rspec-core (~> 3.11.0)
79
+ rspec-expectations (~> 3.11.0)
80
+ rspec-mocks (~> 3.11.0)
81
+ rspec-core (3.11.0)
82
+ rspec-support (~> 3.11.0)
83
+ rspec-expectations (3.11.0)
65
84
  diff-lcs (>= 1.2.0, < 2.0)
66
- rspec-support (~> 3.10.0)
67
- rspec-mocks (3.10.2)
85
+ rspec-support (~> 3.11.0)
86
+ rspec-mocks (3.11.1)
68
87
  diff-lcs (>= 1.2.0, < 2.0)
69
- rspec-support (~> 3.10.0)
70
- rspec-support (3.10.2)
71
- sequel (5.57.0)
88
+ rspec-support (~> 3.11.0)
89
+ rspec-support (3.11.0)
72
90
  shellany (0.0.1)
73
- thor (1.1.0)
74
- yard (0.9.26)
91
+ thor (1.2.1)
92
+ tzinfo (2.0.4)
93
+ concurrent-ruby (~> 1.0)
94
+ webrick (1.7.0)
95
+ yard (0.9.28)
96
+ webrick (~> 1.7.0)
75
97
 
76
98
  PLATFORMS
77
99
  ruby
78
100
 
79
101
  DEPENDENCIES
102
+ activerecord!
103
+ activesupport!
80
104
  benchmark-ips
81
105
  database_cleaner (~> 1.5, >= 1.5.3)
82
106
  guard-rspec
@@ -85,7 +109,6 @@ DEPENDENCIES
85
109
  pry-byebug
86
110
  rake (~> 12, >= 12.2.1)
87
111
  rspec (~> 3.0)
88
- sequel (~> 5.0)
89
112
  yard (~> 0.9.0)
90
113
 
91
114
  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.2.7'
58
+ gem 'mobility', '~> 1.2.8'
59
59
  ```
60
60
 
61
61
  ### ActiveRecord (Rails)
@@ -153,7 +153,13 @@ the ActiveRecord dirty plugin for more information.
153
153
  # suffixes is simplest given they change from Rails version to version.
154
154
  def patterns
155
155
  @patterns ||=
156
- (klass.attribute_method_matchers.map { |p| "#{p.prefix}%s#{p.suffix}" } - excluded_patterns)
156
+ begin
157
+ # Method name changes in Rails 7.1
158
+ attribute_method_patterns = klass.respond_to?(:attribute_method_patterns) ?
159
+ klass.attribute_method_patterns :
160
+ klass.attribute_method_matchers
161
+ attribute_method_patterns.map { |p| "#{p.prefix}%s#{p.suffix}" } - excluded_patterns
162
+ end
157
163
  end
158
164
 
159
165
  private
@@ -159,16 +159,22 @@ Defines:
159
159
  raise KeyError, "No backend for: #{name}"
160
160
  end
161
161
 
162
- def inherited(klass)
163
- parent_classes = mobility_backend_classes.freeze # ensure backend classes are not modified after being inherited
164
- klass.class_eval { @mobility_backend_classes = parent_classes.dup }
165
- super
166
- end
167
-
168
162
  protected
169
163
 
170
164
  def mobility_backend_classes
171
- @mobility_backend_classes ||= {}
165
+ if @mobility_backend_classes
166
+ @mobility_backend_classes
167
+ else
168
+ @mobility_backend_classes = {}
169
+ parent_class = self.superclass
170
+ while parent_class&.respond_to?(:mobility_backend_classes, true)
171
+ # ensure backend classes are not modified after being inherited
172
+ parent_class_classes = parent_class.mobility_backend_classes.freeze
173
+ @mobility_backend_classes.merge!(parent_class_classes)
174
+ parent_class = parent_class.superclass
175
+ end
176
+ @mobility_backend_classes
177
+ end
172
178
  end
173
179
  end
174
180
 
@@ -8,7 +8,7 @@ module Mobility
8
8
  module VERSION
9
9
  MAJOR = 1
10
10
  MINOR = 2
11
- TINY = 7
11
+ TINY = 8
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
data.tar.gz.sig CHANGED
Binary file
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.2.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Salzberg
metadata.gz.sig CHANGED
Binary file