tapioca 0.14.2 → 0.14.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: 3f8cfe1d421099c152f602f65792f694adf8a880014589ff23dc16547c60897d
4
- data.tar.gz: c941e055640e4ef5caf4a26ed50268908fce7098b51c4423144615e04295f6a1
3
+ metadata.gz: 7488dd17c4950978384fa4da4908f6e2f7ad0ad87266a018044e21d565f704aa
4
+ data.tar.gz: 572b9cb88a228d86c46b36c3bb1b938781dfaf528301c1c0a61e0e3258e5b65a
5
5
  SHA512:
6
- metadata.gz: 3d6522f57d604948443018620f625859e8676ddd2978a6e2c6b9252ee39a055526a1fe7dd3ff76f3ed330e3c00f9580fed5ef2fb4a86fdb87c572007f1b43297
7
- data.tar.gz: f1e3c8fbfcfe728906c76b55d8f89762d3e55178c5d89631af7161296b7bb117e3b64bc0b8b03c31ca36cb0181b4b0b3eaede640c54fd1312daacb8ec35f6b4a
6
+ metadata.gz: 1565590d51799b64e7bf57a4d4d25bfe5e20d1455345183412773be5eb5c4f3c7bfecca49438aa2ce67283d1260695d2f072303a5951d7daa1540bd3d4f8ef5c
7
+ data.tar.gz: 00e81fc94389204d15f54e0eb469ca1da367d3b69fedd73e2146f2b0a768d3928848decc94c52fd212e7405d7e8d177571de8e92986090c07ba694c030ae7e66
@@ -69,6 +69,14 @@ module Tapioca
69
69
  "::Money"
70
70
  when ActiveRecord::Type::Integer
71
71
  "::Integer"
72
+ when ActiveRecord::Encryption::EncryptedAttributeType
73
+ # Reflect to see if `ActiveModel::Type::Value` is being used first.
74
+ getter_type = Tapioca::Dsl::Helpers::ActiveModelTypeHelper.type_for(column_type)
75
+ return getter_type unless getter_type == "T.untyped"
76
+
77
+ # Otherwise fallback to String as `ActiveRecord::Encryption::EncryptedAttributeType` inherits from
78
+ # `ActiveRecord::Type::Text` which inherits from `ActiveModel::Type::String`.
79
+ "::String"
72
80
  when ActiveRecord::Type::String
73
81
  "::String"
74
82
  when ActiveRecord::Type::Date
@@ -93,6 +101,9 @@ module Tapioca
93
101
  when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid) &&
94
102
  ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid
95
103
  "::String"
104
+ when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Cidr) &&
105
+ ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Cidr
106
+ "::IPAddr"
96
107
  when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Hstore) &&
97
108
  ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Hstore
98
109
  "T::Hash[::String, ::String]"
@@ -174,7 +174,21 @@ module Tapioca
174
174
  shims_or_todos = extract_shims_and_todos(nodes, shim_rbi_dir: shim_rbi_dir, todo_rbi_file: todo_rbi_file)
175
175
  return false if shims_or_todos.empty?
176
176
 
177
+ not_shims_or_todos = nodes - shims_or_todos
177
178
  shims_or_todos_empty_scopes = extract_empty_scopes(shims_or_todos)
179
+
180
+ # We need to discard classes that are redefining the parent of a class
181
+ shims_or_todos_empty_scopes.select! do |scope|
182
+ # Empty modules are always duplicates
183
+ next true unless scope.is_a?(RBI::Class)
184
+
185
+ # Empty classes without parents are also duplicates
186
+ parent_name = scope.superclass_name
187
+ next true unless parent_name
188
+
189
+ # Empty classes that are not redefining the parent are also duplicates
190
+ not_shims_or_todos.any? { |node| node.is_a?(RBI::Class) && node.superclass_name == parent_name }
191
+ end
178
192
  return true unless shims_or_todos_empty_scopes.empty?
179
193
 
180
194
  mixins = extract_mixins(shims_or_todos)
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
- VERSION = "0.14.2"
5
+ VERSION = "0.14.3"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapioca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ufuk Kayserilioglu
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2024-05-15 00:00:00.000000000 Z
14
+ date: 2024-05-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler