rubocop-rails 2.21.0 → 2.21.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15c354794d638a6c49b01b74961ea1d55f5541f3a8b653ef68d9a824e042a100
|
4
|
+
data.tar.gz: 3a04d9449daac9515b0be93d1394b1aa260748ab6bc57517cf3b90217f58ec88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '01167387c8fcee795769724ded84c4eaa373e2d2d936e8a2b0afd5f4bcb239aafd299b1c302d5a029b7ae72f2990290f2f6de1d317d1cb163f707d5f0ee91635'
|
7
|
+
data.tar.gz: 61d8f93f138aceb3c8e7a8ef03604d5de870b8328e452d34c03f77612681e9846ac7a4f0ed127a48806bb2bfad055e6ccebe9d3393e82e0f4e01ea88a1d870a6
|
@@ -124,19 +124,20 @@ module RuboCop
|
|
124
124
|
update_all
|
125
125
|
where
|
126
126
|
without
|
127
|
-
].freeze
|
127
|
+
].to_set.freeze
|
128
128
|
|
129
|
-
|
130
|
-
|
129
|
+
def_node_matcher :followed_by_query_method?, <<~PATTERN
|
130
|
+
(send (send _ :all) QUERYING_METHODS ...)
|
131
|
+
PATTERN
|
131
132
|
|
132
|
-
|
133
|
-
return unless
|
133
|
+
def on_send(node)
|
134
|
+
return unless followed_by_query_method?(node.parent)
|
134
135
|
return if node.receiver.nil? && !inherit_active_record_base?(node)
|
135
136
|
|
136
137
|
range_of_all_method = node.loc.selector
|
137
138
|
add_offense(range_of_all_method) do |collector|
|
138
139
|
collector.remove(range_of_all_method)
|
139
|
-
collector.remove(
|
140
|
+
collector.remove(node.parent.loc.dot)
|
140
141
|
end
|
141
142
|
end
|
142
143
|
end
|
@@ -69,7 +69,7 @@ module RuboCop
|
|
69
69
|
return if !node.receiver&.str_type? || !node.method?(:to_time)
|
70
70
|
|
71
71
|
add_offense(node.loc.selector, message: MSG_STRING_TO_TIME) do |corrector|
|
72
|
-
|
72
|
+
corrector.replace(node, "Time.zone.parse(#{node.receiver.source})")
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.21.
|
4
|
+
version: 2.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-09-
|
13
|
+
date: 2023-09-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|